How can I set a local branch to pull / merge from a particular remote branch?

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2011-01-06T00:55:54Z Indexed on 2011/01/06 1:53 UTC
Read the original article Hit count: 490

Filed under:

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?

© Stack Overflow or respective owner

Related posts about git