How to remove a branch named "--orphan"

So, I tried 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 named "--orphan"; now it will not let me remove it with git branch -d --orphan . I also tried using quotes and escape characters. Nothing is working. I also tried using gitg to delete and rename a branch; it did not work.

How to delete this thread?

+7
git
source share
1 answer
 git branch -d -- --orphan 

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

+11
source share

All Articles