使用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远程梅干起源,但没用。


当前回答

如果有人觉得这很有用,我会长期遇到这个问题,虽然不是经常出现,因为我在Dropbox中有git目录,从Dropbox中删除了它,一切都很好。

其他回答

如果git-gc--prune=now对您没有帮助。(像我一样倒霉)

我所做的是在本地删除项目,然后重新克隆整个项目。

我在使用SourceTree时遇到了这个问题。我试着再拉一次,结果成功了。我想我切换分行(结账)太快了。

我的情况与海报有点不同,因为我的存储库相对合作,没有任何明显的腐败。

转到颤振文件夹下,然后,

试试看:

git gc --prune=now

git remote prune origin

git pull

尝试使用以下方法清理本地存储库:

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

man git gc(1):

git-gc - Cleanup unnecessary files and optimize the local repository

git gc [--aggressive] [--auto] [--quiet] [--prune=<date> | --no-prune]

       Runs a number of housekeeping tasks within the current repository, such as compressing file revisions
       (to reduce disk space and increase performance) and removing unreachable objects which may have been
       created from prior invocations of git add.

       Users are encouraged to run this task on a regular basis within each repository to maintain good disk
       space utilization and good operating performance.

man git远程(1):

git-remote - manage set of tracked repositories

git remote prune [-n | --dry-run] <name>

           Deletes all stale remote-tracking branches under <name>. These stale branches have already been
           removed from the remote repository referenced by <name>, but are still locally available in
           "remotes/<name>".            
$ rm .git/refs/remotes/origin/master

$ git fetch

来自bitbucket.org:xx/mkyong教程

df0eee8..3f7af90  master     -> origin/master

$ git pull

已经是最新的。