如何设置本地分支从特定远程分支拉/合并?

时间:2011-01-06 00:55:55

标签: git

我有一个本地分支foo,它起源于主人的分支。然后我把它推到我的遥控器上,它现在很高兴和它的兄弟姐妹一起生活在遥控器/原点

我想拉动从遥控器/ origin / foo自动拉动,我想要状态-sb向我显示我在遥控器/原点/ foo之前有多少变化。

我认为这样做的方法是

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

然而,在这样做之后,我收到了这条消息:

➔ git status -sb
## foo
➔ git pull
Your configuration specifies to merge with the ref 'foo'
from the remote, but no such ref was fetched.

我做错了什么?

1 个答案:

答案 0 :(得分:1)

您需要确保在branch.foo.remote之前正确设置branch.foo.mergegit pull,且参数无法正常工作。

请注意,您还可以使用-u--set-upstreamgit push一起在推送操作中设置此信息。

相关问题