【问题标题】:Error message with git pull?git pull 的错误信息?
【发布时间】:2013-11-12 20:07:42
【问题描述】:

我在git 工作,如果我在develop 分支中执行git pull,我会收到以下错误。如何解决此问题以使其停止?

You asked me to pull without telling me which branch you
want to merge with, and 'branch.develop.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.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:
    [branch "develop"]
    remote = <nickname>
    merge = <remote-ref>

    [remote "<nickname>"]
    url = <url>
    fetch = <refspec>

See git-config(1) for details.

【问题讨论】:

    标签: java git version-control


    【解决方案1】:

    正如错误消息所说,您需要指定要提取的分支。例如,如果你想从远程origin拉取分支master,你必须使用命令

    git pull origin master
    

    【讨论】:

      【解决方案2】:

      您可能需要设置本地分支来跟踪远程开发分支。

      假设您的远程被命名为 origin,并且远程分支共享相同的名称,您可以通过 git branch --set-upsteam-to origin/develop develop 执行此操作

      然后您应该能够在不指定远程/分支的情况下执行git pull(假设您已签出开发分支!)

      【讨论】:

      • 看来正确的命令是git branch --set-upsteam-to develop origin/develop
      猜你喜欢
      • 2016-09-08
      • 2012-06-17
      • 2012-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-12
      • 2019-02-02
      相关资源
      最近更新 更多