尝试提交时,使用以下命令:
git commit -a -m "Huge update"
我遇到了致命错误: 提交时无法解析HEAD。
在提交时出现了fatal: could not parse HEAD错误。
阅读fatal: could not parse HEAD Error When Committing后,我执行了以下命令:
git symbolic-ref HEAD refs/heads/master
但没有输出,但我确实得到了
$ git fsck
Checking object directories: 100% (256/256), done.
error: HEAD: invalid sha1 pointer c45fd8579e1f313fcd651df4cbafbf6c8f8edba6
error: refs/heads/master does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
notice: No default references
broken link from commit f10ca5f9234acb473ee000414e2c7d4e939b5e57
to tree 08a537c82c15e09badb41540ceadfb6ac1a8bb31
dangling blob 03165e2de43b743cfe049c40d0ede67fcfb3cc50
missing tree 08a537c82c15e09badb41540ceadfb6ac1a8bb31
dangling blob 1d5469bbebc0a347feef8c0d04fdbf54d87c0a84
dangling blob 1d29ed6cbea9e49273f072de1c61d6893c60a938
dangling blob 259577cbf5a72f6a3565fabb8ce84dc1c7953263
missing blob 3e2a6250392ee3148da37c6c140fc27302125efd
dangling blob 5474b368e2be10dc252d9e21942e748b2d87bd8c
dangling blob 743f1a142592da8050327a6d2e8acc9b5caface7
dangling blob 74823e581bb2cd05256fb4c53109ab6690164077
dangling blob 8399f1b02b73271337addc62e1cc0655a3437a9e
missing blob 99e63739e12ac210f709cc7d5426b46c6b869b65
dangling blob ba11541ed0813e1310b0d721c558f77197854f1f
dangling blob bab5ebd6dfda1be835d15c7704e192e6a9372404
missing blob ca265d70b113843c3080fcb29e14ddb7c50c55a2
missing commit d5750c2c0c209f95d1d6bbd8f763756302fa31b9
dangling blob ebfe8060c0c12ec4b9c7ebebcedbf6c33f435a32
dangling blob f16d2a532c3720bbeb14334a47dc5835532d9841
我可能错了,但是我认为git告诉我去自己解决问题 :-D... :,-/。以下内容似乎证实了这一点:
$ git status
fatal: bad object HEAD
$ git checkout master
fatal: Reference is no "Tree"-object: master
$ git fetch
error: refs/heads/master does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
$ git reflog master
fatal: bad object master
$ git reflog HEAD
fatal: bad object HEAD
还有没有一种方法可以与git协调一致?
我也遇到了这个问题。
$ cat .git/refs/heads/master
c45fd8579e1f313fcd651df4cbafbf6c8f8edba6
$ cat .git/refs/remotes/origin/master
c45fd8579e1f313fcd651df4cbafbf6c8f8edba6
git checkout 分支名
然后再提交吗? - undefinedls -l .git/HEAD ; cat .git/HEAD
? - undefined