How do you create a remote Git branch?

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

    If you wanna actually just create remote branch without having the local one, you can do it like this:

    git push origin HEAD:refs/heads/foo
    

    It pushes whatever is your HEAD to branch foo that did not exist on the remote.

提交回复
热议问题