我使用时出现此错误
git log
fatal:您当前的分支似乎已损坏
我的分支文件被破坏了
我在记事本中打开 .git/refs/heads/mybranch 但我只看到一些
???????
在文件中
我知道我必须找到分支哈希并将其复制到 .git/refs/heads/mybranch 文件中
但我不知道如何找到那个哈希值
我读了这个话题git 中的分支损坏,致命:您当前的分支似乎已损坏 https://stackoverflow.com/questions/33012869/broken-branch-in-git-fatal-your-current-branch-appears-to-be-broken
最后,经过非常痛苦,这对我有用
1 get backup from your .git directory
2 open file .git\logs\refs\heads\<branch name> with your editor
3 copy second hash of your last line
4 open file .git\refs\heads\<branch name> and delete everything in this file
5 past that hash to .git\refs\heads\<branch name>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)