this will delete all other git tags except the 4.1
tag.
git tag | grep -v "4.1" | xargs -n 1 -i% git tag -d %
if you want to also delete the remote tag:
git tag | xargs -n 1 -i% git push origin :refs/tags/%
attribution:
...
hope this helps.
3 may 2022 • 1 minute • tips-tricks
this will delete all other git tags except the 4.1
tag.
git tag | grep -v "4.1" | xargs -n 1 -i% git tag -d %
if you want to also delete the remote tag:
git tag | xargs -n 1 -i% git push origin :refs/tags/%
attribution:
...
hope this helps.