当前位置:   article > 正文

cannot lock ref ‘refs/remotes/origin/dev‘: unable to resolve reference ‘refs/remotes/origin/dev‘: re

cannot lock ref

git提交代码到远程仓库错误,如下图

  1. 9:50 Fetch Failed
  2. cannot lock ref 'refs/remotes/origin/dev': unable to resolve reference 'refs/remotes/origin/dev': reference broken
  3. From https://g.hz.netease.com/mis/fin/yq/api/yq-api
  4. ! [new branch] dev -> origin/dev (unable to update local ref)
  5. cannot lock ref 'refs/remotes/origin/feature/create-invoice-change-to-ap-zxjin': unable to resolve reference 'refs/remotes/origin/feature/create-invoice-change-to-ap-zxjin': reference broken
  6. ! [new branch] feature/create-invoice-change-to-ap-zxjin -> origin/feature/create-invoice-change-to-ap-zxjin (unable to update local ref)
  7. cannot lock ref 'refs/remotes/origin/feature/xy-账务多语言': unable to resolve reference 'refs/remotes/origin/feature/xy-账务多语言': reference broken
  8. ! [new branch] feature/xy-账务多语言 -> origin/feature/xy-账务多语言 (unable to update local ref)
  9. cannot lock ref 'refs/remotes/origin/feature/zjl-invoice': unable to resolve reference 'refs/remotes/origin/feature/zjl-invoice': refer... (show balloon)

网上有推荐命令:

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

尝试执行后失败

  1. Microsoft Windows [版本 10.0.19045.3930]
  2. (c) Microsoft Corporation。保留所有权利。
  3. D:\myProjects\dms-api\src\main\java\com\netease\dms>git gc --prune=now
  4. error: bad ref for .git/logs/refs/remotes/origin/dev
  5. error: bad ref for .git/logs/refs/remotes/origin/feature/create-invoice-change-to-ap-zxjin
  6. error: bad ref for .git/logs/refs/remotes/origin/feature/xy-账务多语言
  7. error: bad ref for .git/logs/refs/remotes/origin/feature/zjl-invoice
  8. error: bad ref for .git/logs/refs/remotes/origin/HEAD
  9. error: bad ref for .git/logs/refs/remotes/origin/release
  10. error: bad ref for .git/logs/refs/remotes/origin/uat
  11. fatal: bad object refs/remotes/origin/HEAD
  12. fatal: failed to run repack

解决方法,到项目的.git 目录下

进入refs/remotes/origin/

删除所有内容

重新提交OK

参考网址:【Git】fatal: bad object refs/remotes/origin/xxx_did not send all necessary objects-CSDN博客

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/一键难忘520/article/detail/963240
推荐阅读
相关标签
  

闽ICP备14008679号