How do you create a remote Git branch?

后端 未结 23 1908
感情败类
感情败类 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:07

    Easiest Solution... Drumm Roll... git version 2.10.1 (Apple Git-78)

    1) git checkout -b localBranchNameThatDoesNotExistInRemote
    
    2) Do your changes, and do a git commit 
    
    3) git push origin localBranchNameThatDoesNotExistInRemote --force
    

    N.B. - The branch you just created in your local environment, and the remote non-existing branch where you are trying to push, must have the same name.

提交回复
热议问题