Git - 删除丢失的斑点或树
Git - remove missing blobs or trees
有没有办法从历史记录中删除对丢失的 blob 或树的引用?这是 git fsck --full
的输出
broken link from tree 99fe1a9d46985ca21e88de53a7a290e2b1889722
to blob bf70d7b3bf98852e13dd0b3b8499ad5d77f174d9
broken link from tree e3dbfdf73cb5c9971b95b33da5fc93f5d69acdae
to tree 5d02b92042c23945f41c5a895e5fc7f4d5a4988d
missing blob bf70d7b3bf98852e13dd0b3b8499ad5d77f174d9
missing blob 1d918846d68d8a8368cc442b6d5989d275944c39
dangling blob 42c2d0f36c782a48f793f6c381578e0e5611b602
missing tree 5d02b92042c23945f41c5a895e5fc7f4d5a4988d
missing blob e9d2ae0e7d9c30dec40a116a12a97567e29a87d2
dangling blob 1aa5f9b48ea74f4a75aa848c571f223995c36658
dangling blob 94055e2bdcc4399c5563327ff879864c59c95e40
dangling commit 2b46b23ef705d48c03ed2526cad6548d1608644b
missing blob 5f5e29e93984bdb1a4bc3be2ba7ebaba1e595e75
我的猜测是 pull
、push
或 git move
被打断了。我计算出大部分丢失的 blob 也引用了哪些文件,但我无法恢复它们,因为它们已经被修改,而且我无法重建更改(我想;但我是 git 的新手)。
gc
、prune
和 reflog --expire=now
没有帮助。
有没有办法告诉git
"It's OK buddy, I'm fine with the current state of the current HEAD
"?
中断 Git 不会这样做。让你的系统 崩溃 (重启)而在一些更新的中间可能会这样做,但普通的中断不会。磁盘故障也会造成这种情况。
参见 Repair corrupted git repository and How to fix corrupted git repository? 我只是将其标记为重复,但我不确定其中哪一个是更好的问答(尽管我自己有点倾向于第二个)。
有没有办法从历史记录中删除对丢失的 blob 或树的引用?这是 git fsck --full
broken link from tree 99fe1a9d46985ca21e88de53a7a290e2b1889722
to blob bf70d7b3bf98852e13dd0b3b8499ad5d77f174d9
broken link from tree e3dbfdf73cb5c9971b95b33da5fc93f5d69acdae
to tree 5d02b92042c23945f41c5a895e5fc7f4d5a4988d
missing blob bf70d7b3bf98852e13dd0b3b8499ad5d77f174d9
missing blob 1d918846d68d8a8368cc442b6d5989d275944c39
dangling blob 42c2d0f36c782a48f793f6c381578e0e5611b602
missing tree 5d02b92042c23945f41c5a895e5fc7f4d5a4988d
missing blob e9d2ae0e7d9c30dec40a116a12a97567e29a87d2
dangling blob 1aa5f9b48ea74f4a75aa848c571f223995c36658
dangling blob 94055e2bdcc4399c5563327ff879864c59c95e40
dangling commit 2b46b23ef705d48c03ed2526cad6548d1608644b
missing blob 5f5e29e93984bdb1a4bc3be2ba7ebaba1e595e75
我的猜测是 pull
、push
或 git move
被打断了。我计算出大部分丢失的 blob 也引用了哪些文件,但我无法恢复它们,因为它们已经被修改,而且我无法重建更改(我想;但我是 git 的新手)。
gc
、prune
和 reflog --expire=now
没有帮助。
有没有办法告诉git
"It's OK buddy, I'm fine with the current state of the current HEAD
"?
中断 Git 不会这样做。让你的系统 崩溃 (重启)而在一些更新的中间可能会这样做,但普通的中断不会。磁盘故障也会造成这种情况。
参见 Repair corrupted git repository and How to fix corrupted git repository? 我只是将其标记为重复,但我不确定其中哪一个是更好的问答(尽管我自己有点倾向于第二个)。