Git : error: object file xxx is empty 错误修复方法

git log发现如下错误信息:

error: object file .git/objects/20/6e7330a25fe1f1e533b5f769103e37e2a5c7f4 is empty
error: object file .git/objects/20/6e7330a25fe1f1e533b5f769103e37e2a5c7f4 is empty
fatal: loose object 206e7330a25fe1f1e533b5f769103e37e2a5c7f4 (stored in .git/objects/20/6e7330a25fe1f1e533b5f769103e37e2a5c7f4) is corrupt

修复指令:

find .git/objects/ -type f -empty | xargs rm
git fetch -p
git fsck --full

OK~

 

上一篇:代码不能改变世界但能改变我F 查询与Q 查询


下一篇:代码优化