从远程 git pull 但没有提取这样的引用?

Mic*_*ega 89 git

我的磁盘上有一个 git 镜像,当我想用​​ git pull 更新我的仓库时,它给了我错误消息:

 Your configuration specifies to merge with the ref '3.5/master' from the remote, but no such ref was fetched.
Run Code Online (Sandbox Code Playgroud)

它还给了我:

  1ce6dac..a5ab7de  3.4/bfq    -> origin/3.4/bfq
  fa52ab1..f5d387e  3.4/master -> origin/3.4/master
  398cc33..1c3000a  3.4/upstream-updates -> origin/3.4/upstream-updates
  d01630e..6b612f7  3.7/master -> origin/3.7/master
  491e78a..f49f47f  3.7/misc   -> origin/3.7/misc
  5b7be63..356d8c6  3.7/upstream-updates -> origin/3.7/upstream-updates
  636753a..027c1f3  3.8/master -> origin/3.8/master
  b8e524c..cfcf7b5  3.8/misc   -> origin/3.8/misc
  * [neuer Zweig]     3.8/upstream-updates -> origin/3.8/upstream-updates
Run Code Online (Sandbox Code Playgroud)

当我运行 make menuconfig 时,它给了我 Linux 版本 3.5.7?这是什么意思?如何更新我的回购?

von*_*and 68

检查您所在的分支 ( git branch),检查该分支的配置 (in .../.git/config),您可能位于错误的分支上,或者您的配置告诉它与(现在?)不存在的远程分支合并。

  • 要删除本地存储库中不存在的远程分支引用,请使用 `git remote prune origin`。 (27认同)
  • 另一种为分支“检查配置”的方法是:`git branch -vv`。显示分支的关联“远程”。 (8认同)
  • 改名分行?不要忘记更新`.git/confg`中的远程分支引用 (2认同)

小智 35

就我而言,我的本地分支没有设置为跟踪远程分支。我不得不手动运行:

git pull origin remotebranch
Run Code Online (Sandbox Code Playgroud)

然后下次你推送时执行“git push -u”来设置正确的跟踪。


小智 14

就我而言,我的本地分支和远程分支的大小写不同。

为了解决这个问题,我删除了我的本地分支$ git branch -d branch-name,然后再次使用$ git fetchand签出远程分支$ git checkout Branch-name。