如何克隆损坏的git回购

维克

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

$ git clone [email protected]: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

有办法解决这个问题吗?

克里斯

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

首先,让我们看看可以克隆什么:

git ls-remote [email protected]:project.git

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

git clone --single-branch --branch refname [email protected]:project.git

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

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

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章