Skip to content

Instantly share code, notes, and snippets.

@regme
Last active September 28, 2018 12:28
Show Gist options
  • Save regme/94c5554dcfcca99e3690edfa87671c2b to your computer and use it in GitHub Desktop.
Save regme/94c5554dcfcca99e3690edfa87671c2b to your computer and use it in GitHub Desktop.
drop all tags from git except 100 last
git tag | grep -E "^[[:alpha:]]" | xargs -n 1 git push --delete origin & git tag | grep -E "^[[:alpha:]]" | xargs git tag -d
git tag | head -n -100 | xargs -n 1 git push --delete origin & git tag | head -n -100 | xargs git tag -d
git fetch --prune origin "+refs/tags/*:refs/tags/*"
@regme
Copy link
Author

regme commented Sep 28, 2018

then all developers should run:

git tag -l | xargs git tag -d
git fetch --tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment