Delete broken branch in git

前端 未结 6 1800
旧时难觅i
旧时难觅i 2020-12-24 12:44

I have created branch with \"git checkout -b mybranch\". It seems that something went wrong, and now I can\'t delete it using \"git branch -D mybranch\". It says: error: bra

6条回答
  •  猫巷女王i
    2020-12-24 13:31

    I had the same problem. The branch was on the list of branches whenever I executed the git branch command, but I couldn't delete it.

    The solution in my case was simple and a bit unexpected: I checked out the broken branch git checkout broken_branch (yes, it worked), then I checked out back to master and... again executed git branch -D broken_branch.

提交回复
热议问题