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

相关推荐
番茄不是西红柿kk4 小时前
deepseek-harness跨平台桌面端二开项目(附git仓库地址+安装包)
git·agent·codex·deepseek·deepseekharness
leoZ2317 小时前
10-Git 仓库蒸馏术:从代码仓库到 OpenClaw 虚拟人-蒸馏工具链
大数据·git·深度学习·神经网络·目标检测·elasticsearch·lstm
fpcc19 小时前
工具使用—git diff命令分析说明
git·工具
console.log('npc')20 小时前
Git 删除指定提交记录操作指南
git
随风丶飘20 小时前
[特殊字符] 告别“update“和“fix bug“——Smart Git Commit LLM 让 AI 帮你写专业的 Git 提交信息
人工智能·git·bug
yanlaifan20 小时前
git clone时候指定换行符
git
小小安于乱1 天前
解决IDEA的git插件pull代码冲突但右下角不提示消息问题
java·git·intellij-idea
ITKEY_1 天前
git 命令行操作回退到指定版本
git
New_Horizons6661 天前
Git 操作(使用git-commit-template)
git
慕容引刀1 天前
或许你真的需要这个Git神器:让团队提交文案终于对齐了
人工智能·git·vscode·自然语言处理·github