How do you create a remote Git branch?

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

    git push -u doesn't work if the newly created branch isn't spawned from the same repo, i.e. if you haven't created the new branch using git checkout -b new_branch, then this will not work.

    For eg, I had cloned two different repositories locally and I had to copy repo2/branch1 to repo1/ and then push it too.

    This link helped me push my local branch (cloned from another repo) to my remote repo:

提交回复
热议问题