我的电脑死机了,现在我的一个 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
I get:
fatal: bad revision 'HEAD'
fatal: bad revision 'HEAD'
fatal: Needed a single revision
You do not have the initial commit yet
那么……我能做什么呢?
Update输出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
我设法通过以下方式恢复:
rm .git/refs/remotes/origin/HEAD
git fetch --all
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)