Git使用git pull 报error: cannot loc
2023-12-21 本文已影响0人
喔牛慢慢爬
问题:
在使用git pull时,报 error: cannot lock ref错误
error: cannot lock ref 'refs/remotes/origin/xxxx': is at xxxxx but expected xxx
解决方法:
运行如下命令解决
git remote prune origin
这将整理本地和服务端的关联,这将删除文件夹中对远程分支的引用.git/refs/remotes/origin,这不会影响您的本地分支机构,也不会更改任何远程对象,但会更新您对远程分支机构的本地引用