I have a local branch foo that started life as a branch off of master. Then I pushed it to my remote, and it’s now happily living life with its siblings in remotes/origin
I want pull to automatically pull from remotes/origin/foo, and I want status -sb to show me how many changes I am ahead of remotes/origin/foo.
I thought the way to do this was
git config branch.foo.merge 'refs/heads/foo'
However, after doing that, I get this message:
➔ git status -sb
## foo
➔ git pull
Your configuration specifies to merge with the ref 'foo'
from the remote, but no such ref was fetched.
What am I doing wrong?
You need to make sure that both
branch.foo.remoteandbranch.foo.mergeare set correctly beforegit pullwithout parameters will work correctly.Note that you can also use
-uor--set-upstreamwithgit pushto set this information on a push operation.