我的硬盘出现故障,导致Git存储库的某些文件损坏。运行时,git fsck --full
我得到以下输出:
error: .git/objects/pack/pack-6863e0a0e4b4ded6090fac5d12eba6ca7346b19c.pack SHA1 checksum mismatch
error: index CRC mismatch for object 6c8cae4994b5ec7891ccb1527d30634997a978ee from .git/objects/pack/pack-6863e0a0e4b4ded6090fac5d12eba6ca7346b19c.pack at offset 97824129
error: inflate: data stream error (invalid code lengths set)
error: cannot unpack 6c8cae4994b5ec7891ccb1527d30634997a978ee from .git/objects/pack/pack-6863e0a0e4b4ded6090fac5d12eba6ca7346b19c.pack at offset 97824129
error: inflate: data stream error (invalid stored block lengths)
error: failed to read object 0dcf6723cc69cc7f91d4a7432d0f1a1f05e77eaa at offset 276988017 from .git/objects/pack/pack-6863e0a0e4b4ded6090fac5d12eba6ca7346b19c.pack
fatal: object 0dcf6723cc69cc7f91d4a7432d0f1a1f05e77eaa is corrupted
我有存储库的备份,但是包含打包文件的唯一备份已经损坏了。因此,我认为我必须找到一种从不同备份中检索单个对象的方法,并以某种方式指示Git生成仅包含正确对象的新包。
您能给我提示如何修复我的存储库吗?
.git
当然不包括文件夹)复制到新克隆的存储库中...然后git status
在新存储库中进行了... git正确检测到对文件的所有受影响的更改,因此我可以重新开始工作。