Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
542 views
in Technique[技术] by (71.8m points)

version control - git push to specific branch

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, it's not clear from the documentation.

I would like to use my 'real world' example. Following is what I see when I run the git status command on the top level of my branch:

On branch amd_qlp_tester

Your branch is ahead of 'origin/amd_qlp_tester' by 5 commits.

etc...

My branch name is amd_qlp_tester but it was "branched" off from the main branch (if I have the terms wrong it's because of my SVN background). But then there is also the name origin/amd_qlp_testser

So how do I phrase my push command?

Is it any of the following?

git push origin/amd_qlp_tester
git push origin amd_qlp_tester
git push amd_qlp_tester
git push origin
git push
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If your Local branch and remote branch is the same name then you can just do it:

git push origin branchName

When your local and remote branch name is different then you can just do it:

git push origin localBranchName:remoteBranchName

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...