tags:

views:

26

answers:

1

So I was trying to create an orphan branch. I tried a couple of things and one of them (git checkout -b --orphan newbranch) managed to create a branch called "--orphan"; now it won't let me delete it using git branch -d --orphan. I've also tried using quotes and escape characters. Nothing seems to work. I also tried using gitg to delete and to rename the branch; this didn't work.

How can I delete this branch?

+2  A: 
git branch -d -- --orphan

Everything after -- is taken as an argument and not a switch. This works in many places in git (and in many Unix programs as well).

Wayne Conrad