进行git pull时,有时会出现以下错误:
error: object file .git/objects/e6/093637c867f4e4dac46f28725b1897eac09ac7 is empty
fatal: loose object e6093637c867f4e4dac46f28725b1897eac09ac7 (stored in .git/objects/e6/093637c867f4e4dac46f28725b1897eac09ac7) is corrupt
它不会经常发生,但经常让我环顾四周,以获取有关如何防止它发生的提示,但我什么也找不到。你们对如何防止这种情况有任何建议,或者我做错了什么?
为解决此问题,我一直在运行git fsck
,并且像现在这样显示出更多的丢失/损坏的文件(数量通常有所不同):
error: object file .git/objects/dd/e924b37ff52fa6c2d06400f78f7e39e5ed6e35 is empty
error: unable to mmap .git/objects/dd/e924b37ff52fa6c2d06400f78f7e39e5ed6e35: No such file or directory
error: dde924b37ff52fa6c2d06400f78f7e39e5ed6e35: object corrupt or missing: .git/objects/dd/e924b37ff52fa6c2d06400f78f7e39e5ed6e35
error: object file .git/objects/e5/24fe77212c65a8c63fc469fd78bcfe0c9a1ebe is empty
error: unable to mmap .git/objects/e5/24fe77212c65a8c63fc469fd78bcfe0c9a1ebe: No such file or directory
error: e524fe77212c65a8c63fc469fd78bcfe0c9a1ebe: object corrupt or missing: .git/objects/e5/24fe77212c65a8c63fc469fd78bcfe0c9a1ebe
error: object file .git/objects/e6/093637c867f4e4dac46f28725b1897eac09ac7 is empty
error: unable to mmap .git/objects/e6/093637c867f4e4dac46f28725b1897eac09ac7: No such file or directory
error: e6093637c867f4e4dac46f28725b1897eac09ac7: object corrupt or missing: .git/objects/e6/093637c867f4e4dac46f28725b1897eac09ac7
error: object file .git/objects/e9/667f6312eb5f8bdb17b836b7f6865fe8376add is empty
error: unable to mmap .git/objects/e9/667f6312eb5f8bdb17b836b7f6865fe8376add: No such file or directory
error: e9667f6312eb5f8bdb17b836b7f6865fe8376add: object corrupt or missing: .git/objects/e9/667f6312eb5f8bdb17b836b7f6865fe8376add
Checking object directories: 100% (256/256), done.
Checking objects: 100% (955/955), done.
error: object file .git/objects/e6/093637c867f4e4dac46f28725b1897eac09ac7 is empty
error: object file .git/objects/e6/093637c867f4e4dac46f28725b1897eac09ac7 is empty
fatal: loose object e6093637c867f4e4dac46f28725b1897eac09ac7 (stored in .git/objects/e6/093637c867f4e4dac46f28725b1897eac09ac7) is corrupt
我只是删除这些文件,然后运行git fetch
。
那没关系,可以持续一段时间。
(我是新来的,请放心...)