简体   繁体   中英

How to remove a branch named “--orphan”

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?

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 other Unix programs).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM