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
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: