git “bad index file sha1 signature fatal: index file corrupt”错误

在执行commit或revert等操作时,提示“bad index file sha1 signature fatal: index file corrupt”错误,导致操作失败。这是由于git的index文件出错。需要删除.git/index文件,然后在仓库目录下运行git reset,重新生成index文件。
git reset还可以删除已经commit,但未push上去的信息。

原文地址:https://www.cnblogs.com/grimm/p/7390128.html