How to remove all git origin and local tags?

青春壹個敷衍的年華 提交于 2020-01-30 13:43:26

问题


How do you remove a git tag that has already been pushed? Delete all git remote (origin) tags and Delete all git local tags.


回答1:


1. Delete All local tags. (Optional Recommended)

git tag -d $(git tag -l)

2. Fetch remote All tags. (Optional Recommended)

git fetch

3. Delete All remote tags.

git push origin --delete $(git tag -l) # Pushing once should be faster than multiple times

4. Delete All local tags.

git tag -d $(git tag -l)



回答2:


For windows using command prompt:

Deleting local tags:

for /f "tokens=* delims=" %a in ('git tag -l') do git tag -d %a

Deleting remote tags:

for /f "tokens=* delims=" %a in ('git tag -l') do git push --delete origin %a


来源:https://stackoverflow.com/questions/44702757/how-to-remove-all-git-origin-and-local-tags

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