【发布时间】:2020-07-16 18:55:46
【问题描述】:
从我的 GitLab 服务器 repocheck.md 收到报告说我的一个存储库存在问题。这就是问题所在:
E, [2020-04-04T10:25:00.323291 #27099] ERROR -- : Could not fsck repository: broken link from tree 8c7ba0f6c712df32e991ae9262f1c7514fd22473
to blob 806164c98a18ddc2295c246e5509674471d6f54a
missing blob 806164c98a18ddc2295c246e5509674471d6f54a
如何解决服务器上的这个问题?
我在客户端上有一份很好的仓库副本:
Pete@sev MINGW64 ~/Documents/path/to/client/repo (master)
$ git gc
Enumerating objects: 536, done.
Counting objects: 100% (536/536), done.
Delta compression using up to 8 threads
Compressing objects: 100% (424/424), done.
Writing objects: 100% (536/536), done.
Total 536 (delta 177), reused 338 (delta 104)
Pete@sev MINGW64 ~/Documents/path/to/client/repo (master)
$ git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (536/536), done.
【问题讨论】:
-
强制将好的副本推送到服务器。
-
谢谢。没有修复它。尝试
git push --force(未修复),然后尝试git push --force-with-lease(未修复)。 -
否则,请尝试从本地 repo 中识别丢失对象所在的分支,然后执行
git push --no-thin branch-at-stake:branch-at-stake。 -
(参见
git push --no-thin的文档) -
谢谢。关于
--no-thin的好建议!仍然没有解决问题。这看起来类似于此处未解决的问题:stackoverflow.com/questions/52428788/…。还尝试在服务器目录上运行git-repair,但没有修复。接下来,将 .git 目录内容复制到我的服务器(在存档现有服务器内容之后)并使用git fsck --full重新扫描。期待荣耀。