简体   繁体   English

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

[英]Getting fatal: object is corrupted when pushing to a remote repo

I've got a server with Gitolite installed to host my repos I created a new repo yesterday and today when I tried to push more commits to the server I am getting: 我有一台安装了Gitolite的服务器来托管我的存储库我昨天创建了一个新的repo,今天当我尝试将更多提交推送到我得到的服务器时:

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

As the repo is pretty new I wasn't too bothered about losing previous commits so I have deleted both my local and remote repo but still getting the same error. 由于回购是相当新的,我不会因为丢失以前的提交而烦恼所以我删除了我的本地和远程仓库,但仍然得到相同的错误。

As I say I'm not too concerned about maintaing my commit history, I would just like to get it working again! 正如我所说,我不太关心维护我的提交历史,我只想让它再次运行!

As seen in the comments, any additional repo has an issue during its creation (ie when pushing back the gitolite-admin repo with the gitolite.conf file declaring a new repo) 正如评论中所见,任何额外的仓库在其创建过程中都存在问题(即,当使用gitolite.conf文件推回新的gitolite-admin时,推回gitolite-admin gitolite.conf

I didn't notice this before but when I create a new repo I'm getting the following error: 之前我没有注意到这一点,但是当我创建一个新的repo时,我收到以下错误:

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 但它正在/home/git/repositories创建repo

This operation takes place in a post-compilation trigger called ssh-authkeys : 此操作在名为ssh-authkeys的后编译触发器中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;
}

That means ssh-keygen -l -f <path_to_public_key.pub> doesn't follow the right pattern, as shown in " self service key management ". 这意味着ssh-keygen -l -f <path_to_public_key.pub>不遵循正确的模式,如“ 自助服务密钥管理 ”中所示。

Make sure that your key is generated like: 确保您的密钥生成如下:

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

Update April 2015: 2015年4月更新:

As mentioned by starfry in " Gitolite - remote: FATAL: fingerprinting failed for 'keydir/' ": 正如starfry在“ Gitolite - remote:FATAL:指纹识别'keydir /'失败”中所提到的

There was a change to the key fingerprint format in OpenSSH at version 6.8: 版本6.8中OpenSSH中的密钥指纹格式发生了变化:

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. FingerprintHash选项添加到ssh(1)sshd(8) ,并将等效的命令行标记添加到其他工具以控制用于关键指纹的算法。 The default changes from MD5 to SHA256 and format from hex to base64. 默认值从MD5更改为SHA256,格式从十六进制到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 latest git checkout of gitolite is aware , since 18th March '15, of this new format. 自15年3月18日以来, 最新的gitolite git结账了解这种新格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM