How do you create a remote Git branch?

后端 未结 23 2200
感情败类
感情败类 2020-11-22 13:31

I created a local branch which I want to \'push\' upstream. There is a similar question here on Stack Overflow on how to track a newly created remote branch.

Howeve

23条回答
  •  借酒劲吻你
    2020-11-22 14:20

    First you create the branch locally:

    git checkout -b your_branch
    

    And then to create the branch remotely:

    git push --set-upstream origin your_branch
    

    Note: This works on the latests versions of git:

    $ git --version
    git version 2.3.0
    

    Cheers!

提交回复
热议问题