[英]git -cant pull or commit
我在提交和拉取时遇到问题:在提交 IDE 中,我看到:
warning not all local changes may be shown due to an error: unable to read tree
并且只有部分文件提交存在,我也看不到与最新版本的差异。
当我尝试拉/取时:
error: refs/remotes/origin/project-1 does not point to a valid object!
error: refs/remotes/origin/project-2 does not point to a valid object!
....
等等
最后,错误是
fatal: pack has 268 unresolved deltas
我有什么办法可以在不克隆的情况下修复它?
好的,我通过使用修复了它
mv -v .git .git_old && # remove old git
git init && # initialise new repo
git remote add origin "${url}" && # link to old repo
git fetch && # get old history
git reset origin/master --mixed # force update to old history
它来自这个堆栈问题如何修复损坏的 git 存储库?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.