Why do I need to explicitly push a new branch?

前端 未结 8 1676
遥遥无期
遥遥无期 2020-11-22 00:48

I am new in git and I am practicing. I created a local branch but I saw that when I did git push my branch was not uploaded to the repository. I ha

8条回答
  •  情话喂你
    2020-11-22 01:16

    HEAD is short for current branch so git push -u origin HEAD works. Now to avoid this typing everytime I use alias:

    git config --global alias.pp 'push -u origin HEAD'

    After this, everytime I want to push branch created via git -b branch I can push it using:

    git pp

    Hope this saves time for someone!

提交回复
热议问题