Deleting a badly named git branch

后端 未结 6 984
一生所求
一生所求 2020-11-22 11:53

I know this isn\'t strictly a programming question, but it is related to git. I accidentally have created a branch in git called --track (I got the order of opt

6条回答
  •  一向
    一向 (楼主)
    2020-11-22 12:08

    I had a similar problem where I accidentally ended up with a "-r" branch. I couldn't figure out how to remove it using git commands so I just remove it in the .git folder:

    $ cd .git/refs/head $ ls *r -r $ rm "*r"

    This solution was only safe because it was the only branch listed that ended in "r" but it did solve the problem...

提交回复
热议问题