search

Home  >  Q&A  >  body text

github - How to move the HEAD of the git remote branch?

Local branch: master and feature
Remote branch: origin master and origin feature

Local switch to feature
git branch -a shows that the remote HEAD points to origin master

At this time, when I git push without adding -u, does it automatically push to the origin master?
So now I want it to HEAD to the origin feature like this

What to do

我想大声告诉你我想大声告诉你2853 days ago704

reply all(2)I'll reply

  • 漂亮男人

    漂亮男人2017-05-02 09:38:01

    You can try it

    git push origin master:feature
    If you add

    -u, it will be remembered.

    But I don’t recommend you to do this, be careful of yourself.

    It is recommended to read more git manpages, such as man git-push, which has explanations.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-02 09:38:01

    git push <远程主机名> <本地分支名>:<远程分支名>

    reply
    0
  • Cancelreply