我的电脑死机了,现在我的一个 git 存储库坏了。当我尝试结帐大师时,它告诉我:
warning: ignoring broken ref refs/heads/master.
error: Your local changes to the following files would be overwritten by checkout:
com.vainolo.jdraw2d.releng.p2/pom.xml
Please, commit your changes or stash them before you can switch branches.
Aborting
当我执行时,git stash
我得到:
fatal: bad revision 'HEAD'
fatal: bad revision 'HEAD'
fatal: Needed a single revision
You do not have the initial commit yet
那么……我该怎么办?
更新
输出git reflog
:
fatal: bad default revision 'HEAD'
不是很有希望...输出git fsck
:
error: Invalid HEAD
Checking object directories: 100% (256/256), done.
error: unable to unpack 59551f96b4e87a1c14293c19eb548ce6fa1f196f header
error: inflateEnd: stream consistency error (no message)
fatal: loose object 59551f96b4e87a1c14293c19eb548ce6fa1f196f (stored in .git/objects/59/551f96b4e87a1c14293c19eb548ce6fa1f196f) is corrupt