Why do I need to do `--set-upstream` all the time?

后端 未结 21 2049
南方客
南方客 2020-11-22 09:15

I create a new branch in Git:

git branch my_branch

Push it:

git push origin my_branch

Now say someone mad

21条回答
  •  遇见更好的自我
    2020-11-22 09:37

    I personally use these following alias in bash

    in ~/.gitconfig file

    [alias]
        pushup = "!git push --set-upstream origin $(git symbolic-ref --short HEAD)"
    

    and in ~/.bashrc or ~/.zshrc file

    alias gpo="git pushup"
    alias gpof="gpo -f"
    alias gf="git fetch"
    alias gp="git pull"
    

提交回复
热议问题