当 Ubuntu 显然崩溃(一切都被冻结,我什至无法移动鼠标指针)迫使我硬重启计算机时,我正在本地处理一个项目(我没有时间推到原点)。
现在,当我尝试使用任何 git 命令时,它一直在说:
error: object file .git/objects/5b/44c9bbc189d41c9eff05fdb381ebd2dc83c1e3 is empty
fatal: loose object 5b44c9bbc189d41c9eff05fdb381ebd2dc83c1e3 (stored in .git/objects/5b/44c9bbc189d41c9eff05fdb381ebd2dc83c1e3) is corrupt
我没有我所做工作的远程副本。我实际上是在一个名为activity
.
我怎样才能恢复它?我真的不想在干净的 git-repo 克隆上复制更改,因为它会丢失所有以前的提交消息......
以下类似的帖子(如果它似乎不适用于我的情况)这里有一些输出:
$ git fsck --full
Checking object directories: 100% (256/256), done.
error: object file .git/objects/18/c482efa7845af0ab2d2ebc19370ca6645cda68 is empty
fatal: loose object 18c482efa7845af0ab2d2ebc19370ca6645cda68 (stored in .git/objects/18/c482efa7845af0ab2d2ebc19370ca6645cda68) is corrupt
我还使用以下(相同)输出运行 ls-tree:
$ git ls-tree 5b44c9bbc189d41c9eff05fdb381ebd2dc83c1e3
error: object file .git/objects/5b/44c9bbc189d41c9eff05fdb381ebd2dc83c1e3 is empty
fatal: loose object 5b44c9bbc189d41c9eff05fdb381ebd2dc83c1e3 (stored in .git/objects/5b/44c9bbc189d41c9eff05fdb381ebd2dc83c1e3) is corrupt
谢谢。