The tl;dr of the question is in the title, but here's the scenario:
I have project P forked on github, which has been sitting stale for sometime. Meanwhile, the upstream version of the project has been moving forward, with some commits and, critically, some new branches.
So, now I want to dust it off and get up to date. I clone the existing fork of P into my machine, and check git status
:
On branch master
Your branch is up-to-date with 'origin/master'.
So, the local master
is tracking origin/master
. Now, I add the upstream
remote and do a git fetch upstream
, where I see that there are some new branches. I want to get some of those into origin
too, and that's where I'm confused. After a lot of searching, it seems that the common advice is similar to the one here: Get new upstream branch with git where you set up new local branches to track the new upstream
branches, and then push them into your origin
.
The issue is, after this process, your master
is set to track origin/master
, and shinynewbranch
is set to track upstream/shinynewbranch
, and the asymmetry of this tells me something is wrong.
So, what is the common convention regarding tracking, when there's both an origin and an upstream involved? Is "master tracks origin, other branches track upstream" truly the common pattern?