git pull 时报cannot lock ref ‘xxx‘ ... unable to update local ref错误时的解决办法
当从远程仓库拉取代码时:git pull报错如下:error: cannot lock ref 'refs/remotes/origin/innertag': is at 0440433ebbca6fc0a3dc041946346d004ae1d7ee but expected 98150e1dcad8640daa66b5499d6e234d71806a6eFrom code.xxx.com:xc
·
当从远程仓库拉取代码时:git pull
报错如下:
error: cannot lock ref 'refs/remotes/origin/innertag': is at 0440433ebbca6fc0a3dc041946346d004ae1d7ee but expected 98150e1dcad8640daa66b5499d6e234d71806a6e
From code.xxx.com:xchannel/xc-centre
! 98150e1d..7a2c45c5 innertag -> origin/innertag (unable to update local ref)
Please make sure you have the correct access rights
and the repository exists.
解决方法:
1,执行命令: git gc --prune=now
2,再执行:git remote prune origin
git gc --prune=now
git remote prune origin
最后 git pull 即可正常执行
更多推荐
已为社区贡献1条内容
所有评论(0)