git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Delete branch start with "-"

From
YHYoann Hervé <yoann.herve.ext@makina-corpus.com>
Date
Apr 9, 2009, 12:28 UTC
Message-ID
<49DDEA00.9090003@makina-corpus.com>

Hello, by mistake I have created a branch with a "-" at the beginning of his name, and now I can't delete it.

 git branch -d -f
 error: unknown switch `s'
 usage: git-branch [options] [-r | -a] [--merged | --no-merged]
    or: git-branch [options] [-l] [-f] <branchname> [<start-point>]
    or: git-branch [options] [-r] (-d | -D) <branchname>
    or: git-branch [options] (-m | -M) [<oldbranch>] <newbranch>
 Generic options
     -v, --verbose         be verbose
     --track               set up tracking mode (see git-pull(1))
     --color               use colored output
     -r                    act on remote-tracking branches
     --contains <commit>   print only branches that contain the commit
     --abbrev[=<n>]        use <n> digits to display SHA-1s
 Specific git-branch actions:
     -a                    list both remote-tracking and local branches
     -d                    delete fully merged branch
     -D                    delete branch (even if not merged)
     -m                    move/rename a branch and its reflog
     -M                    move/rename a branch, even if target exists
     -l                    create the branch's reflog
     -f                    force creation (when already exists)
     --merged              list only merged branches
How can I delete it ?

Thanks, Yoann

Next: Björn Steinbrink
Message 1 of 2 in “Delete branch start with "-"”
  1. Yoann HervéApr 9, 2009
  2. Björn SteinbrinkApr 9, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.