我刚刚想在另一台远程服务器上克隆一个存储库,但是遇到了问题:
git clone git@codebasehq.com:blah/blah/docs.git
Cloning into docs...
remote: Counting objects: 343, done.
remote: error: unable to find 14f87a739828e4d489b0310a51e057b30333926e
remote: Compressing objects: 100% (325/325), done.
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: fatal: unable to read 14f87a739828e4d489b0310a51e057b30333926e
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed
我进行了一些研究并发现了 git fsck
,这是它的输出:
$ git fsck --full
error: sha1 mismatch 14f87a739828e4d489b0310a51e057b30333926e
error: 14f87a739828e4d489b0310a51e057b30333926e: object corrupt or missing
missing blob 14f87a739828e4d489b0310a51e057b30333926e
所有其他遇到类似问题的人都遇到了链接失效或类似的问题。我在 Git 中还很新,有人知道如何解决这个问题吗?
我仍然可以将代码推送到我的中央远程仓库,但无法克隆它。
14f87a739828e4d489b0310a51e057b30333926e
是存储库根目录中的一个 Markdown 文件。我尝试删除此文件并将更改推送到服务器,但没有成功。
编辑: 是否可能从另一个存储库导入 git 历史记录?我想我可以启动一个新的存储库,将我的文件复制到其中,然后导入提交历史记录。