fatal: your current branch appears to be broken

懵懂的女人 提交于 2020-04-14 12:14:11

问题


I give this error when I use

 git log

fatal: your current branch appears to be broken

my branch file was broked I opened .git/refs/heads/mybranch in notepad but I see only some ????????? in file

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

I read this topic Broken branch in git, fatal: your current branch appears to be broken


回答1:


finally, after very pain, this worked for me

1 get back up 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>


来源:https://stackoverflow.com/questions/57580891/fatal-your-current-branch-appears-to-be-broken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!