In git how can I delete all tags(local and remote) except the latest one

Viewed 1957

I want to delete all the tags (local and remote) in my git repo except the latest one. I have read the posts about deleting all tags but could not find the info about deleting them selectively i.e. delete all tags except the latest one

3 Answers

To delete locally all tags (even for Windows):

git tag -d `git tag | grep -E '.'`

I've found solution here.

Related