Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git-无法获取/拉取/克隆_Git_Github_Gitlab - Fatal编程技术网

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

Git-无法获取/拉取/克隆,git,github,gitlab,Git,Github,Gitlab,我在获取、提取或克隆我的回购协议时出现以下错误: $ git fetch remote: error: Could not read 9bc3bd2d69d3eeebdbb916f5b6126b7714f90e75 remote: fatal: bad tree object 9bc3bd2d69d3eeebdbb916f5b6126b7714f90e75 remote: aborting due to possible repository corruption on the remote s

我在获取、提取或克隆我的回购协议时出现以下错误:

$ 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
当I
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

我在这里该怎么办?(此repo在gitlab上,我尝试在sourcetree和git bash上获取它)

我确认我也无法克隆该repo;)(我可以访问Jean Henry的回购协议)

我描述了正确的恢复过程,再次引用

目标是获取任何仍在运行的最新克隆并解压缩其包文件,以搜索丢失的对象(这里是一棵树)。
见“

mv.git/objects/pack/*
对于i in/*.pack;做
git解包对象-r<$i
完成
rm/*
解包后,您可以查找文件
/git/objects/9b/c3bd2d69d3eeebdbb916f5b6126b7714f90e75
:将其复制到服务器上的裸repo。
并进行git fsck以确认错误已消失

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