使用git 1.6.4.2时,当我尝试git pull时,会出现以下错误:

error: unable to resolve reference refs/remotes/origin/LT558-optimize-sql: No such file or directory
From git+ssh://remoteserver/~/misk5
 ! [new branch]      LT558-optimize-sql -> origin/LT558-optimize-sql  (unable to update local ref)
error: unable to resolve reference refs/remotes/origin/split-css: No such file or directory
 ! [new branch]      split-css  -> origin/split-css  (unable to update local ref)

我尝试过git远程梅干起源,但没用。


当前回答

尝试以下操作:gitbranch--取消上游设置

我之前遇到过这个问题,但当我在终端上看到这个命令时,我刚刚解决了这个问题。

其他回答

试试看:

git pull origin Branch_Name

Branch_Name,您当前所在的分支。

如果您只执行一个git pull,它也会提取所有其他创建的分支名称。

所以你得到这个的原因是:

! [new branch]      split-css  -> origin/split-css  (unable to update local ref)

我在作曲家更新方面也遇到了同样的问题。但对我来说,只有在我清除了composer缓存并删除了供应商文件夹的内容后,它才起作用:

rm -rf vendor/*
git gc --prune=now
git pull
composer clear-cache
composer update my/package

从项目中手动删除特定分支的文件

.git/refs/remotes/origin/master
 git gc --prune=now
 git pull

尝试了这些,但没有对我起作用:

$ git gc --prune=now
$ git remote prune origin
$ git fetch --prune

我不得不通过删除本地文件夹并再次克隆来解决这个问题。

执行以下命令:

rm .git/refs/remotes/origin/master

git fetch

git branch --set-upstream-to=origin/master

以防万一,如果你需要知道什么是.git/refs/remotes/origin/master,您将阅读remotes部分在Git参考中。