使用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 remote prune origin
,但没有用。
发布于 2017-05-11 06:11:31
git fetch --prune
为我修复了这个错误:
[marc.zych@marc-desktop] - [~/code/driving] - [Wed May 10, 02:58:25]
[I]> git fetch
error: cannot lock ref 'refs/remotes/origin/user/janek/integration/20170505': 'refs/remotes/origin/user/janek/integration' exists; cannot create 'refs/remotes/origin/user/janek/integration/20170505'
From github.com:zooxco/driving
! [new branch] user/janek/integration/20170505 -> origin/user/janek/integration/20170505 (unable to update local ref)
From github.com:zooxco/driving
[marc.zych@marc-desktop] - [~/code/driving] - [Wed May 10, 02:58:30]
[I]> git fetch --prune
- [deleted] (none) -> origin/user/janek/integration
但是,这假设在远程服务器上删除了违规分支。
您还可以将其添加到~/.gitconfig
,以便在运行git fetch
时自动修剪
[fetch]
prune = true
https://stackoverflow.com/questions/2998832
复制相似问题