【问题标题】:Git pull doesn't know which branch to merge withgit pull 不知道要合并哪个分支
【发布时间】:2013-03-05 23:00:38
【问题描述】:

我承诺并推动。

然后其他人更改了我的分支中的某些内容,提交并推送。 我试图拉动,因为我想得到这些改变。

结果:

From servername
3de3ee5..4db9ed8  Andrea     -> origin/Andrea
You asked me to pull without telling me which branch you
want to merge with, and 'branch.Andrea.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

问题是我不明白这个解释。 我的分支名称肯定是Andrea,但是,git pull andrea 也不起作用。 怎么拉?

【问题讨论】:

  • git pull origin Andrea
  • 我猜在推送时,您并没有真正将推送的分支设置为本地分支的“上游”。尝试git branch -u origin/Andrea Andrea,然后再次拉动。也就是说这只是一个猜测,您应该看看是否可以为我们提供重现您提到的错误的步骤。
  • 你看过stackoverflow.com/questions/7388278/… 吗?看起来很相似。
  • 谢谢,问题已回答。
  • @newnewbie 不要忘记将您的问题标记为已回答或关闭它

标签: git pull


【解决方案1】:

这将从分支 origin/Andrea 中提取。 当您将分支更改为经常提取时非常有用。 如果您经常从同一个分支中提取,您可能需要在设置中进行设置,如here

【讨论】:

  • 虽然这段代码 sn-p 可以解决问题,including an explanation 确实有助于提高您的帖子质量。请记住,您是在为将来的读者回答问题,而这些人可能不知道您提出代码建议的原因。
猜你喜欢
  • 2011-02-22
  • 2015-11-01
  • 1970-01-01
  • 2011-03-04
  • 2018-09-16
  • 2015-09-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多