The manpage for git pull, below "Options related to fetching" says
You never do your own development on branches that appear on the right hand side of a colon on Pull: lines; they are to be updated by git fetch. If you intend to do development derived from a remote branch B, have a Pull: line to track it (i.e. Pull: B:remote-B), and have a separate branch my-B to do your development on top of it. The latter is created by git branch my-B remote-B (or its equivalent git checkout -b my-B remote-B). Run git fetch to keep track of the progress of the remote side, and when you see something new on the remote branch, merge it into your development branch with git pull . remote-B, while you are on my-B branch.
We've been trialling a workflow which is:
git fetch origin
git checkout -b un-3437 origin/un-3437
I believe that un-3437 in the example is B in the manpage comment. Therefore we should then branch from un-3437. However, this seems to be a lot of extra work.
Secondly, ignoring the second branch idea in the paragraph above, we are finding that git status
will say that the local branch is ahead of the remote by x commits. We don't understand how that would be if we've just done git pull
.
Our mental model appears to be wrong. Is there a good resource to explain all these pointers?