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

相关推荐
无限进步_1 天前
【C++】验证回文字符串:高效算法详解与优化
java·开发语言·c++·git·算法·github·visual studio
无限进步_1 天前
【C++】重载、重写和重定义的区别详解
c语言·开发语言·c++·ide·windows·git·github
历程里程碑1 天前
1 . Git本地操作:版本控制 跨平台协作 仓库核心
java·开发语言·数据结构·c++·git·gitee·github
华科大胡子1 天前
Git + 云原生
git
johnny2331 天前
Git拓展:GitButler、Gitnuro、JGit
git
王的宝库1 天前
GitLab 常用 Git 命令新手指南
git·学习
马优晨1 天前
git restore --source 提交id 和 git reset --hard 提交id 有什么区别
git·git reset·git restore·git回退的区别·git回退代码
小臭希1 天前
Git(代码版本控制系统)
java·git·github
Unity粉末状在校生2 天前
Git解决fatal: Could not read from remote repository.的问题
git
少年攻城狮2 天前
Obsidian系列---【如何使用obsidian同步到git?】
git