How to delete Git tag named starting with dash?

风格不统一 提交于 2019-12-11 11:17:40

问题


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?


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/22711383/how-to-delete-git-tag-named-starting-with-dash

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!