如何克隆损坏的git回购

时间:2019-04-12 20:15:14

标签: git

我从尝试克隆存储库中得到的错误:

$ git clone git@repo.xx.xx.com:project.git
Cloning into 'project'...
remote: fatal: empty filename in tree entry
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: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed

有没有办法解决这个问题?

1 个答案:

答案 0 :(得分:2)

在没有对服务器或干净副本的管理访问权限的情况下,您几乎无能为力。但是,由于您认为损坏会影响最近的某些提交,因此您可以尝试克隆另一个分支,看看是否可行。

首先,让我们看看可用于克隆的内容

git ls-remote git@repo.xx.xx.com:project.git

这应该为您提供服务器上可用参考的列表。找到候选人后,请尝试使用

进行克隆
git clone --single-branch --branch refname git@repo.xx.xx.com:project.git