Skip to content

Instantly share code, notes, and snippets.

@dearaujoj
Created November 17, 2014 13:33
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 dearaujoj/f36fb463c9d8cf19c16b to your computer and use it in GitHub Desktop.
Save dearaujoj/f36fb463c9d8cf19c16b to your computer and use it in GitHub Desktop.
delete local and remote Git tags programatically
#check tag with specific value
for i in 2013 ; do git tag -l | grep "$i" ; git ls-remote --tags origin | awk '{print ":"$2}' | grep "$i" | grep -v '{}' ; done
#delete local and remote tag with specific value
for i in 2013 ; do git tag -l | grep "$i" | xargs git tag -d ; git ls-remote --tags origin | awk '{print ":"$2}' | grep "$i" | grep -v '{}' | xargs git push origin ; done
#credits http://anavarre.net/2014/01/07/delete-local-and-remote-git-tags-programatically
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment