Use main branch if present

pull/1886/head
Zhengnan Zhao 2021-05-30 17:45:49 -04:00
parent 8c47706139
commit 4115c3a732
1 changed files with 14 additions and 2 deletions

View File

@ -37,8 +37,6 @@ alias gcb='git checkout -b'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gcobu='git checkout -b ${USER}/'
alias gcom='git checkout master'
alias gcpd='git checkout master; git pull; git branch -D'
alias gct='git checkout --track'
# clone
@ -196,3 +194,17 @@ esac
function gdv() {
git diff --ignore-all-space "$@" | vim -R -
}
function gcom() {
if git branch | grep -q main; then
git checkout main
else
git checkout master
fi
}
function gcpd() {
gcom
git pull
git branch -D
}