解决git pull拉取更新代码失败,unable to resolve reference ‘refs/remotes/origin/xxx分支名’: reference broken问题

摘要

   近期在合并拉取代码,在合并分支代码时不知做了什么操作,使用 git pull 命令更新本地代码失败,显示本地分支参考关联损坏失效。具体的错误提示如下图所示:

解决方案

  1、根据错误提示,找到本地 .git 中损坏的 ‘refs/remotes/origin/xxx分支名’文件,删除即可。

  2、删除损坏的文件后,再使用 git pull 重新拉取更新远程端的代码即可完美解决。

参考文章:

  https://blog.walterlv.com/post/git-fetch-failed-for-reference-broken.html

原文地址:https://www.cnblogs.com/BlueBerryCode/p/12993733.html