difference between origin/branch_name and branch_name?

前端 未结 4 1796
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 02:26

for pushing to bitbucket.

If I do: git push origin origin/branch_name my commits are not pushed.

Total 0 (delta 0), reused 0 (delta 0)
<         


        
4条回答
  •  鱼传尺愫
    2020-11-29 03:03

    using a graphical tree viewer (like gitk --all) will show you, that origin/mybranch and mybranch might differ.

    origin is just the default name for a cloned remote, which (in your case) contains a branch mybranch (just like your local repository)

    so when you ask to push origin/mybranch to origin, you are synchronizing the origin remote with itself, hence it doesn't do anything (luckily the remote is always in synch with itself).

    the name origin is arbitrary, and could have been set with the --origin flag when cloning.

提交回复
热议问题