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

后端 未结 21 2020
南方客
南方客 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:28

    All i wanted was doing something like this:

    git checkout -b my-branch
    git commit -a -m "my commit"
    git push
    

    Since i didn't found a better solution, i've just created an bash alias on ~/.bashrc:

    alias push="git push -u origin HEAD"
    

    now just doing a push command does the job (you can add this alias on ~/.gitconfig too with another name, such as pushup)

提交回复
热议问题