How do I delete a branch with the name starting with '-'

后端 未结 1 1554
野趣味
野趣味 2021-01-19 10:06

In an attempt to create a tracking branch I have managed to create a local branch named \'-t\'. I cannot delete the branch because the branch name is also a parameter. This

相关标签:
1条回答
  • 2021-01-19 10:33

    Use the -- option

    git branch -D -- -t
    

    As you can read here

    a double dash (--) is used in bash built-in commands and many other commands to signify the end of command options

    Git won't treat -t as an option anymore, since it comes after the --.

    0 讨论(0)
提交回复
热议问题