Git克隆失败,文件损坏

时间:2015-10-12 09:17:26

标签: git https gitlab

在我们公司,我们使用自己的GitLab 7.13.4安装。 Access配置为允许https和ssh身份验证。当使用版本为1.7,1.9或2的git客户端克隆现有项目时,可以使用这两种身份验证方法。但是,对于使用git版本1.6.0.2的旧版(SLES 11)服务器,https方法会产生以下错误:

> git clone https://myuser@my.host/myrepo/myproject
Initialized empty Git repository in /users/myrepo/myuser/myproject/.git/
error: File 0000000000000000000000000000000000000000 (https://myuser@my.host/myrepo/myproject/objects/00/00000000000000000000000000000000000000) corrupt
Getting pack list for https://myuser@my.host/myrepo/myproject
Getting alternates list for https://myuser@my.host/myrepo/myproject
Also look at https://myuser@my.host//<!
Also look at window.gon={};gon.default_issues_tracker="gitlab";gon.api_version="v3";gon.relative_url_root="";gon.default_avatar_url="https://my.host/assets/no_avatar-0b64d25ac5f63e6f0caee99e819105ba.png";gon.max_file_s
Segmentation fault

ssh-method工作得很好。问题是我们希望防止必须将私钥文件复制到服务器上,并且还要更新git客户端安装。您对如何解决此错误有任何建议,或者是否需要更新客户端?

1 个答案:

答案 0 :(得分:0)

首先,如果您尚未对服务器上的所有重要数据进行备份。

0000...是实际文件名还是占位符?

如果它实际上是0000...,那么一些非常奇怪的东西被推送到git repo(一个树的文件无效的提交;但是树实际上并没有因为sha1和匹配而损坏?我不确定是怎么发生的,但你必须隔离错误的提交并弄清楚如何修复它。

如果它不是0000...而是一些有效的SHA1总和,请尝试在另一个结帐中找到该文件(来自<repo-root>/.git/objects/xx/xxxxxxx)并手动将其复制到服务器。如果对象在一个包中,您可以尝试unpacking

相关问题