트러블슈팅
fatal: your current branch appears to be broken 깃에러
노엠디엔
2023. 7. 19. 18:20
평소와 같이 코드에 수정내용 git add . 와 git commit을 시도했는데 다음과 같은 에러가 발생했다.
fatal: cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/main': reference broken
암튼 HEAD broken이라길래 머리에 문제가 생긴 것 같았다.;; git log 찍어보니
fatal: your current branch appears to be broken 해당 에러도 발생
검색을 통해 여러 방법을 시도해봤는데 해결되지 않았다..
https://burning-camp.tistory.com/20
https://www.reddit.com/r/git/comments/lgovpv/how_to_deal_with_a_broken_head/
https://itecnote.com/tecnote/r-broken-branch-in-git-fatal-your-current-branch-appears-to-be-broken/
pull 이랑 push를 진행하면서 예전에 기존에 있던 파일을 삭제하고 똑같은 내용에 파일을 붙여넣었었는데
그게 문제가 된 것 같았다. 결국 해결 방법으로 레포지토리를 갈아 엎는 방법이 좋다는 결론이 나와
레포지토리 삭제 후 새로 만들어 진행하였다..