Delete all git tags from a project
By Mike Street
To delete the git tags on the remote (e.g. Github or GitLab) you need to have the tags locally - as it uses the local list.
Ensure you have the tags locally by running git fetch origin
, you can then run git tag
to confirm there are tags there.
Removing the tags from remote can then be done with:
git push origin --delete $(git tag -l)
This passes the result of git tag -l
into the --delete
parameter.
To delete locally, you can run:
git tag -d $(git tag)