add git-related function and alias
This commit is contained in:
parent
c0a77bcbce
commit
0f59131666
11
bash/bashrc
11
bash/bashrc
|
@ -43,4 +43,15 @@ rss() {
|
|||
cd -
|
||||
}
|
||||
|
||||
# stolen from stackoverflow
|
||||
# code from a stranger is always perfect
|
||||
git_main_branch () {
|
||||
git branch | cut -c 3- | grep -E '^master$|^main$'
|
||||
}
|
||||
|
||||
gp() {
|
||||
git push -u origin $(git_main_branch)
|
||||
}
|
||||
|
||||
alias gs='git status'
|
||||
alias f=files
|
||||
|
|
Loading…
Reference in New Issue