git 使用过程中,长时间没有更新了,git pull 出现如下问题:
error: cannot lock ref 'refs/remotes/origin/test/xx': 'refs/remotes/origin/test' exists; cannot create 'refs/remotes/origin/test/xx'
原因是远程分支已经删除了,本地仍然存在记录,刷新本地仓库即可。
git remote prune origin
当gitpull遇到cannotlockref错误,可能是因为远程分支已被删除但本地仍有记录。解决方法是使用`gitremotepruneorigin`来刷新本地仓库并清理不再存在的远程引用。
git 使用过程中,长时间没有更新了,git pull 出现如下问题:
error: cannot lock ref 'refs/remotes/origin/test/xx': 'refs/remotes/origin/test' exists; cannot create 'refs/remotes/origin/test/xx'
原因是远程分支已经删除了,本地仍然存在记录,刷新本地仓库即可。
git remote prune origin
2133
5149
1万+
1415

被折叠的 条评论
为什么被折叠?