git 操作 (unable to update local ref) 错误

遇到

error: cannot lock ref 'refs/remotes/origin/xxxxx': is at f2bf9464723084c6200db078a4b0c110a8cebd0e but expected 704e18de10027c529b4c2f75fc575edff9989d37

! 704e18de1..87fbe790e xxxxxxx -> origin/xxxxxxxx (unable to update local ref)

错误时,

执行
git fetch --prune origin

无效时 执行
git branch -m main_backup

rm -Force -Recurse .git\refs\remotes\origin

重新创建主分支

git checkout -b main origin/main

相关推荐
满天星830357715 分钟前
【Git】原理及使用(三)(分支管理)
linux·git
像风一样的男人@4 小时前
warning: could not find UI helper ‘git-credential-manager-ui‘
git·ui
代钦塔拉5 小时前
Git & GitHub 从入门到精通:全流程实战教程
git·github
晚风吹红霞6 小时前
Linux下的趣味编程 —— 进度条、Git版本控制与GDB调试实战
linux·运维·git
xlq223227 小时前
7.git
git
Ws_7 小时前
Git + Gerrit 第六课:commit --amend、Patch Set 与 Change-Id
git
AIMath~1 天前
向github中上传文件过大超过50M怎么办
网络·git·github
AIMath~1 天前
如何将一个新的文件夹使用git 工具提交到github新仓库中
git·github
满天星83035771 天前
【Git】原理及使用(二) (版本回退)
linux·git
愿天垂怜1 天前
【C++脚手架】ffmpeg 库的介绍与使用
linux·服务器·开发语言·c++·ide·git·ffmpeg