git – 致命:推送到远程仓库时对象已损坏

我有一台安装了Gitolite的服务器来托管我的存储库我昨天创建了一个新的repo,今天当我尝试将更多提交推送到我得到的服务器时:

fatal: object 86eeaa0c5a154ff3df34d6a43669930b9c6c7f59 is corrupted
error: unpack failed: unpack-objects abnormal exit
error: failed to push some refs to

由于回购是相当新的,我不会因为丢失以前的提交而烦恼所以我删除了我的本地和远程仓库,但仍然得到相同的错误.

正如我所说,我不太关心维护我的提交历史,我只想让它再次运行!

最佳答案
正如评论中所见,任何额外的仓库在其创建过程中都存在问题(即,当使用gitolite.conf文件推回新的仓库时,推回gitolite-admin仓库)

I didn’t notice this before but when I create a new repo I’m getting the following error:

remote: line 1 too long: command="/home/git/gitolite/src/gitolite... 
remote: FATAL: fingerprinting failed for /tmp/Cdug9Itivq 

But it’s creating the repo in /home/git/repositories

此操作在名为ssh-authkeys的后编译触发器中进行:

sub fp_file {
    return $selinux++ if $selinux; # return a unique "fingerprint" to prevent noise
    my $f = shift;
    my $fp = `ssh-keygen -l -f '$f'`;
    chomp($fp);
    _die "fingerprinting failed for '$f'" unless $fp =~ /([0-9a-f][0-9a-f](:[0-9a-f][0-9a-f])+)/;
    $fp = $1;
    return $fp;
}

这意味着ssh-keygen -l -f< path_to_public_key.pub>没有遵循正确的模式,如“self service key management”所示.

确保您的密钥生成如下:

ssh-keygen -t rsa -f "${H}/.ssh/git" -C "Gitolite Admin access (not interactive)" -q -P ""

2015年4月更新:

starfry在“07​​003”中所述:

There was a change to the key fingerprint format in OpenSSH at version 6.8:

Add FingerprintHash option to ssh(1) and sshd(8), and equivalent command-line flags to the other tools to control algorithm used for key fingerprints. The default changes from MD5 to SHA256 and format from hex to base64.

Fingerprints now have the hash algorithm prepended.
An example of the new format:

SHA256:mVPwvezndPv/ARoIadVY98vAC0g+P/5633yTC4d/wXE

Please note that visual host keys will also be different.

The 07004, since 18th March ’15, of this new format.

转载注明原文:git – 致命:推送到远程仓库时对象已损坏 - 代码日志