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

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

    You can make this happen with less typing. First, change the way your push works:

    git config --global push.default current
    

    This will infer the origin my_branch part, thus you can do:

    git push -u
    

    Which will both create the remote branch with the same name and track it.

提交回复
热议问题