In Git, how can I delete multiple tags before pushing?
I know how to do it with one tag at a time. Not sure if it's possible to do multiple.
Use Git to delete a Git tag To delete the Git tag from the local repo, run the git tag -d tag-name command where tag-name is the name of the Git tag you want to delete.
By default, git push will not push tags. Tags have to be explicitly passed to git push . To push multiple tags simultaneously pass the --tags option to git push command.
To delete locally multiple tags: git tag:
git tag -d <tagname>...
So simply:
git tag -d TAG1 TAG2 TAG3
To delete multiple tags remotely: git push:
git push [-d | --delete] [<repository> [<refspec>...]]
So simply:
git push ${REMOTE_NAME:-origin} --delete TAG1 TAG2 TAG3
TL;DR:
git tag -d TAG1 TAG2 TAG3 git push origin -d TAG1 TAG2 TAG3
It will delete all matching tag patterns.
//Delete remote: git push -d origin $(git tag -l "tag_prefix*") // Delete local: git tag -d $(git tag -l "tag_prefix*") // Examples: git tag -d $(git tag -l "v1.0*") git push -d origin $(git tag -l "*v3.[2]*-beta*")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With