Git:“损坏的松散物体” [英] Git: "Corrupt loose object"

查看:373
本文介绍了Git:“损坏的松散物体”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我从遥控器拉出来,我都会得到关于压缩的以下错误。当我运行手动压缩时,我得到相同的结果:

  $ git gc 
错误:无法读取3813783126d41a3200b35b6681357c213352ab31
致命:错误树对象3813783126d41a3200b35b6681357c213352ab31
错误:无法运行重新包装

有没有人知道,该怎么办?



从cat-file中得到这个:

  $ git cat-file -t 3813783126d41a3200b35b6681357c213352ab31 
错误:无法找到3813783126d41a3200b35b6681357c213352ab31
致命错误:git cat-file 3813783126d41a3200b35b6681357c213352ab31:坏文件

从git fsck我得到了这个(不知道它是否真的有关系):

<$ p $数据流错误(无效距离太远)
错误:损坏的松散对象'45ba4ceb93bc812ef20a6630bb27e9e0b33a012a'
致命:松散对象45ba4ceb93bc812ef20a6630bb27e9e0b33a012a (存储在.git / objects / 45 / ba4c中eb93bc812ef20a6630bb27e9e0b33a012a)已损坏

任何人都可以帮我解密这个吗?

解决方案

看起来你有一个损坏的树对象。你需要从其他人处获得该物体。希望他们能有一个没有破坏的版本。



如果你猜猜哪些文件应该在那里,你找不到别人的有效版本,你实际上可以重建它。你可能想看看日期和时间对象的次数与它匹配。那些可能是相关的斑点。您可以从这些对象中推断出树对象的结构。



看看关于git内部的Scott Chacon的Git Screencasts 。这将向你展示git如何在引擎盖下工作,以及如果你真的陷入困境并不能从别人那里获得这个对象,那么怎么去做这个侦探工作。


Whenever I pull from my remote, I get the following error about compression. When I run the manual compression, I get the same:

$ git gc
error: Could not read 3813783126d41a3200b35b6681357c213352ab31
fatal: bad tree object 3813783126d41a3200b35b6681357c213352ab31
error: failed to run repack

Does anyone know, what to do about that?

From cat-file I get this:

$ git cat-file -t 3813783126d41a3200b35b6681357c213352ab31
error: unable to find 3813783126d41a3200b35b6681357c213352ab31
fatal: git cat-file 3813783126d41a3200b35b6681357c213352ab31: bad file

And from git fsck I get this ( don't know if it's actually related):

$ git fsck
error: inflate: data stream error (invalid distance too far back)
error: corrupt loose object '45ba4ceb93bc812ef20a6630bb27e9e0b33a012a'
fatal: loose object 45ba4ceb93bc812ef20a6630bb27e9e0b33a012a (stored in .git/objects/45/ba4ceb93bc812ef20a6630bb27e9e0b33a012a) is corrupted

Can anyone help me decipher this?

解决方案

Looks like you have a corrupt tree object. You will need to get that object from someone else. Hopefully they will have an uncorrupted version.

You could actually reconstruct it if you can't find a valid version from someone else by guessing at what files should be there. You may want to see if the dates & times of the objects match up to it. Those could be the related blobs. You could infer the structure of the tree object from those objects.

Take a look at Scott Chacon's Git Screencasts regarding git internals. This will show you how git works under the hood and how to go about doing this detective work if you are really stuck and can't get that object from someone else.

这篇关于Git:“损坏的松散物体”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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