add git-related function and alias

This commit is contained in:
randomuser 2022-12-24 00:54:45 -06:00
parent c0a77bcbce
commit 0f59131666
1 changed files with 11 additions and 0 deletions

View File

@ -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