I used gcm(alias to git checkout $(git_main_branch)) to switch branches in my project, but switched to trunk branch, I expected to switch to master branch.
echo $(git_main_branch)
trunk
change git_main_branch to master rather than trunk. In my other project, git_main_branch is master as my expected
You can override the function in your .zshrc like so:
function git_main_branch() {
def=`git remote show origin | sed -n '/HEAD branch/s/.*: //p'`
echo $def
}
refs:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With