致命:提交时无法解析HEAD错误 [英] fatal: could not parse HEAD Error When Committing
问题描述
每当我尝试提交工作时,都会出现此错误.
Whenever I try to commit my work, I get this error.
fatal: could not parse HEAD
如果我想保留更改,该怎么办?
What should I do if I want to preserve my changes?
推荐答案
您知道HEAD
应该指向哪个分支吗?是master
吗?运行git symbolic-ref HEAD refs/heads/master
.
Do you know what branch HEAD
was supposed to point to? Was it master
? Run git symbolic-ref HEAD refs/heads/master
.
基本上,名称为HEAD
的符号引用已损坏.您(或您运行的软件)一定已经在.git
目录下戳了一下.如果我是你,我将检查以确保回购中的其他内容均未损坏.您可以通过运行git fsck
来验证对象数据库.
Basically, the symbolic reference with the name HEAD
is corrupted somehow. You (or software you ran) must have gone poking around the .git
dir. If I were you I would check to make sure nothing else in your repo is damaged. You can verify your object database by running git fsck
.
这篇关于致命:提交时无法解析HEAD错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!