Skip to content

Instantly share code, notes, and snippets.

@josegonzalez
Created March 17, 2011 18:16
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 josegonzalez/874832 to your computer and use it in GitHub Desktop.
Save josegonzalez/874832 to your computer and use it in GitHub Desktop.
delete all tags but the last 100 in a git repository
for tag in `git tag | sort | sed -e :a -e '$d;N;2,100ba' -e 'P;D'`; do git tag -d $tag && git push origin :refs/tags/$tag; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment