Broken branch in git, fatal: your current branch appears to be broken

前端 未结 9 1416
时光说笑
时光说笑 2021-02-01 12:57

Here is my case:

  • I was working on one branch.
  • Pushed new commits to the remote.
  • Switched back to the master branch.

But suddenly

9条回答
  •  無奈伤痛
    2021-02-01 13:38

    You branch name now probably contains some special characters or something like that.

    You should go to the root-directory of your check-out (where the .git/ directory is) and

    1. List item edit .git/packed-refs; if you see a line with your branch name then delete it
    2. look in .git/refs/heads for a file named after your branch; if you see one, delete it

提交回复
热议问题