致命:当推送到远程回购时,对象已损坏 [英] Getting fatal: object is corrupted when pushing to a remote repo

查看:139
本文介绍了致命:当推送到远程回购时,对象已损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经安装了一台安装了Gitolite的服务器来托管我的回购协议我昨天和今天创建了一个新的回购协议,当时我试图将更多的提交推送到服务器上:

 致命:对象86eeaa0c5a154ff3df34d6a43669930b9c6c7f59已损坏
错误:解包失败:解压缩对象异常退出
错误:无法将某些参考推送到

由于回购非常新,所以我并不太担心丢失以前的提交,因此我已经删除了本地和远程回购,但是仍然收到相同的错误。



正如我所说,我并不太在意维护我的提交历史记录,我只想让它再次运行!

解决方案

从评论中可以看出,任何额外的repo在创建时都会遇到问题(即推回 gitolite- admin repo与 gitolite.conf 文件声明一个新的回购)

lockquote

我没有注意到这个信息但当我创建一个新的回购时,我收到以下错误:



  remote:第1行太长:command =/ home / git / gitolite / src / gitolite ... 
remote:致命:指纹失败/ tmp / Cdug9Itivq




但它在 / home / git / repositories

该操作发生在名为 ssh-authkeys / p>

  sub fp_file {
return $ selinux ++ if $ selinux; #返回一个独特的指纹,以防止噪音
my $ f = shift;
my $ fp =`ssh-keygen -l -f'$ f'`;
chomp($ fp); (0-9a-f)[0-9a-f](:[0-9a-f] [0-9a-f])之后,'
_die'指纹失败'$ f' ])+)/;
$ fp = $ 1;
返回$ fp;
}

这意味着 ssh-keygen -l -f < ; path_to_public_key.pub> 不符合正确的模式,如自我服务密钥管理



确保您的密钥生成如下:



<$ $ {H} /。ssh / git-CGitolite管理访问权限(不是交互式)-q -P
pre> ssh-keygen -t rsa -f






2015年4月更新:



正如 starfry Gitolite - remote:致命:'keydir /'的指纹识别失败:


到6.8版OpenSSH中的关键指纹格式:



FingerprintHash 选项添加到 ssh (1) sshd(8)和等效的com mand-line标志到其他工具来控制用于密钥指纹的算法。从MD5到SHA256的默认更改以及从十六进制到64位格式。



现在指纹前面加了散列算法。

新格式示例:



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




请注意,可视主持人密钥也不同。



自3月18日以来, gitolite的最新git结帐已经知道了 '15,这是新格式。


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:

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)

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

This operation takes place in a post-compilation trigger called 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".

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:

As mentioned by starfry in "Gitolite - remote: FATAL: fingerprinting failed for 'keydir/'":

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 latest git checkout of gitolite is aware, since 18th March '15, of this new format.

这篇关于致命:当推送到远程回购时,对象已损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆