Skip to content

Instantly share code, notes, and snippets.

@PiDayDev
Created October 2, 2019 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PiDayDev/54ae6b7081fa31ae90d7e6b371855714 to your computer and use it in GitHub Desktop.
Save PiDayDev/54ae6b7081fa31ae90d7e6b371855714 to your computer and use it in GitHub Desktop.
Delete all tags from a local and remote GIT repository
#
# NOTE: use with caution - this will PERMANENTLY delete ALL tags from your repository
#
# git tag -l ==> list all tags
# | awk ...... ==> for each TAG_NAME, print the line "git tag -d TAG_NAME && git push --delete origin TAG_NAME"
# (the first command deletes local tag, the second deletes remote tag)
# | sh ==> execute each command printed by awk
git tag -l | awk '{print "git tag -d " $0 " && git push --delete origin " $0}' | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment