git报错系统列---bad ref for .git/logs/refs/remotes/origin/develop

解决方案:

先执行命令:

  1. git gc --prune=now 
  2. git remote prune origin

尝试执行后失败后会报如下的错:

D:\myProjects\dms-api\src\main\java\com\netease\dms>git gc --prune=now
error: bad ref for .git/logs/refs/remotes/origin/dev
error: bad ref for .git/logs/refs/remotes/origin/feature/create-invoice-change-to-ap-zxjin
error: bad ref for .git/logs/refs/remotes/origin/feature/xy-账务多语言
error: bad ref for .git/logs/refs/remotes/origin/feature/zjl-invoice
error: bad ref for .git/logs/refs/remotes/origin/HEAD
error: bad ref for .git/logs/refs/remotes/origin/release
error: bad ref for .git/logs/refs/remotes/origin/uat
fatal: bad object refs/remotes/origin/HEAD
fatal: failed to run repack

解决方法,到项目的.git 目录下,如果没有这个目录,查看隐藏的目录:

进入refs/remotes/origin/,删除该目录下的所有内容

posted @ 2024-10-22 10:17  爱生活,爱代码  阅读(45)  评论(0编辑  收藏  举报