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

I have a local branch foo that started life as a master blade. Then I pushed him to my remote, and now he lives happily with his brothers and sisters in remotes / parentage

I want to pull to automatically pull out / origin / foo from the remote controls, and I want status -sb to show me how many changes I'm ahead of the / origin / foo remote control.

I thought a way to do this:

git config branch.foo.merge 'refs/heads/foo'

However, after 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?

+3
source share
1 answer

You need to make sure that both options branch.foo.remoteand branch.foo.mergeare set correctly before git pullwith no parameters will work correctly.

, -u --set-upstream git push, push.

+1

Source: https://habr.com/ru/post/1783768/


All Articles