1

运行“git gc”时出现以下错误:

    chris@chris-VirtualBox:~/code/dataquality$ git gc --aggressive
Counting objects: 3849, done.
error: object file .git/objects/1e/6a84c4e4202c469c188b69fd23407fca44d69d is empty
error: unable to find 1e6a84c4e4202c469c188b69fd23407fca44d69d
error: object file .git/objects/95/9dbfcdfd3ef09088e652d4e5526df66bc53323 is empty
error: unable to find 959dbfcdfd3ef09088e652d4e5526df66bc53323
error: object file .git/objects/9c/3f15a856fda402d82131bb9ea35ea7d27ae05d is empty
error: unable to find 9c3f15a856fda402d82131bb9ea35ea7d27ae05d
error: object file .git/objects/cf/bdc18aab11c9cbada9fb1ac73c347352b7a4fb is empty
error: unable to find cfbdc18aab11c9cbada9fb1ac73c347352b7a4fb
error: object file .git/objects/db/0ee0587a14cc0cdfa43ccda0d0b2010c7701b6 is empty
error: unable to find db0ee0587a14cc0cdfa43ccda0d0b2010c7701b6
Delta compression using up to 8 threads.
Compressing objects: 100% (3539/3539), done.
error: object file .git/objects/db/0ee0587a14cc0cdfa43ccda0d0b2010c7701b6 is empty
fatal: loose object db0ee0587a14cc0cdfa43ccda0d0b2010c7701b6 (stored in .git/objects/db/0ee0587a14cc0cdfa43ccda0d0b2010c7701b6) is corrupt
error: failed to run repack

我不知道如何解决这些错误。我应该采取哪些步骤?

当我运行git fsck --full这是输出:

chris@chris-VirtualBox:~/code/dataquality$ git fsck --full
error: object file .git/objects/1e/6a84c4e4202c469c188b69fd23407fca44d69d is empty
fatal: loose object 1e6a84c4e4202c469c188b69fd23407fca44d69d (stored in .git/objects/1e/6a84c4e4202c469c188b69fd23407fca44d69d) is corrupt
4

1 回答 1

0

由于git fsck --full在新克隆上返回了相同的错误,因此损坏的对象在分支中使用。来自的讨论部分git help fsck对您的情况有这样的说法:

       Any corrupt objects you will have to find in backups or other archives 
       (i.e., you can just remove them and do an rsync with some other site in
       the hopes that somebody else has the object you have corrupted).

因此,如果您有一个带有此对象的旧克隆,您可能能够恢复。如果您没有备份,此答案可能对您有用。

于 2013-01-17T17:39:49.980 回答