美文网首页
2018-12-21 How do you push just

2018-12-21 How do you push just

作者: 五大RobertWu伍洋 | 来源:发表于2019-01-02 20:43 被阅读4次

    git how to push only current branch but not all branch

    By default git push updates all the remote branches. But you can configure git to update only the current branch to it's upstream.

    git config push.default upstream

    It means git will update only the current (checked out) branch when you do git push.

    you can configure git globally, to affect all of your workspaces to behave that way:

    git config --global push.default upstream

    So let's say you have a local branch foo, a remote called origin and a remote branch origin/master.

    To push the contents of foo to origin/master, you first need to set its upstream:

    git checkout foo
    git branch -u origin/master
    

    Then you can push to this branch using:

    git push origin HEAD:master

    相关文章

      网友评论

          本文标题:2018-12-21 How do you push just

          本文链接:https://www.haomeiwen.com/subject/icpmkqtx.html