2012年10月22日 星期一

[Git] error: bad index file sha1 signature fatal: index file corrupt

Error:
I got an error message below.
$ git pull --rebase
error: bad index file sha1 signature
fatal: index file corrupt
error: bad index file sha1 signature
fatal: index file corrupt
error: bad index file sha1 signature
fatal: index file corrupt
Cannot pull with rebase: You have unstaged changes.
error: bad index file sha1 signature
fatal: index file corrupt
Additionally, your index contains uncommitted changes.
Please commit or stash them.


Solve:
1. Delete file .git/index
2. git reset --hard HEAD


Reference:
http://blog.wu-boy.com/2010/08/git-%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6%EF%BC%9A%E5%88%A9%E7%94%A8-git-reset-%E6%81%A2%E5%BE%A9%E6%AA%94%E6%A1%88%E3%80%81%E6%9A%AB%E5%AD%98%E7%8B%80%E6%85%8B%E3%80%81commit-%E8%A8%8A%E6%81%AF/

沒有留言:

張貼留言