How to delete Git tag named starting with dash?

2019-07-26 18:59发布

I tried deleting the git tag name which is named as -d using command git tag -d -d but couldn't able to delete it.

Any ideas?

2条回答
别忘想泡老子
2楼-- · 2019-07-26 19:02

git tag -d -- -d is the usual way to tell a *nix program that the argument after -- is not an option but rather a positional argument. This is how you can remove files named -f and so on.

查看更多
看我几分像从前
3楼-- · 2019-07-26 19:09

I had the same issue.

git tag -d -- -d

did not work for me.

However this did work:

git tag -d `git tag -l '*-d*'`

Explanation:

  • List tags matching *-d*
  • Pass resulting list to git tag -d
查看更多
登录 后发表回答