Git-无法提取/拉取/克隆

让·亨利

在获取,拉出或克隆我的仓库时出现以下错误:

$ git fetch
remote: error: Could not read 9bc3bd2d69d3eeebdbb916f5b6126b7714f90e75
remote: fatal: bad tree object 9bc3bd2d69d3eeebdbb916f5b6126b7714f90e75
remote: aborting due to possible repository corruption on the remote side.
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header

当我 git -fsck

$ git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (148557/148557), done.

当我git prune那时git gc

$ git gc
Counting objects: 148557, done.
Compressing objects: 100% (26144/26144), done.
Writing objects: 100% (148557/148557), done.
Total 148557 (delta 90234), reused 148557 (delta 90234)

我在这里搜索了一些解决方案,有人建议删除或移动对象树,但是:

$ git ls-tree 9bc3bd2d69d3eeebdbb916f5b6126b7714f90e75
fatal: not a tree object

我应该在这里做什么?(此存储库位于gitlab上,我尝试在sourcetree和git bash上获取它)

我确认我也无法克隆该存储库;)(我可以使用Jean Henry的存储库)

我描述了6年前的正确恢复过程,并于2014年再次引用

目标是获取任何仍起作用的最新克隆并解压缩其打包文件,以搜索丢失的对象(此处为树)。
请参阅“如何恢复由于硬盘故障而损坏的Git对象?

mv .git/objects/pack/* <somewhere>
for i in <somewhere>/*.pack; do
  git unpack-objects -r < $i
done
rm <somewhere>/*

解压缩后,您可以查找文件./git/objects/9b/c3bd2d69d3eeebdbb916f5b6126b7714f90e75:将其复制到服务器上的裸仓库中。
并执行git fsck确认错误已消失。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章