git push to specific branch

后端 未结 4 1104
礼貌的吻别
礼貌的吻别 2021-01-29 22:39

Even after reading this question: git-push-current-branch, I am still having difficulty figuring out how I should write my git push command. As mentioned in the question link, i

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-29 23:05

    I would like to add an updated answer - now I have been using git for a while, I find that I am often using the following commands to do any pushing (using the original question as the example):

    • git push origin amd_qlp_tester - push to the branch located in the remote called origin on remote-branch called amd_qlp_tester.
    • git push -u origin amd_qlp_tester - same as last one, but sets the upstream linking the local branch to the remote branch so that next time you can just use git push/pull if not already linked (only need to do it once).
    • git push - Once you have set the upstream you can just use this shorter version.

    Note -u option is the short version of --set-upstream - they are the same.

提交回复
热议问题