致命:您当前的分支似乎已损坏 [英] fatal: your current branch appears to be broken
本文介绍了致命:您当前的分支似乎已损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用
git log
致命:您当前的分支似乎已损坏
fatal: your current branch appears to be broken
我的分支文件已损坏 我在记事本中打开了.git/refs/heads/mybranch,但我只看到了一些 ????????? 在文件中
my branch file was broked I opened .git/refs/heads/mybranch in notepad but I see only some ????????? in file
我知道我必须找到分支哈希并将其复制到.git/refs/heads/mybranch文件中 但我不怎么找到那个哈希
I know I must find branch hash and copy that into .git/refs/heads/mybranch file but I don't how to find that hash
我读了这个话题 git中的残破分支,致命:您当前分支似乎已损坏
推荐答案
最后,在非常痛苦的情况下,这对我有用
finally, after very pain, this worked for me
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>
这篇关于致命:您当前的分支似乎已损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文