Skip to content

Instantly share code, notes, and snippets.

@wteuber
Created January 14, 2014 09:14
Show Gist options
  • Select an option

  • Save wteuber/8415455 to your computer and use it in GitHub Desktop.

Select an option

Save wteuber/8415455 to your computer and use it in GitHub Desktop.
clean up git tags
# delete all non-version tags
git ls-remote | grep -oe "refs/tags[^\^]*" | uniq | grep -vE "v201[34]-[0-9][0-9]" | xargs git push --delete origin
# delete RCs of 2013 versions
git ls-remote | grep -oe "refs/tags[^\^]*" | uniq | grep -E "v2013-.*rc[0-9][0-9]" | xargs git push --delete origin
# only keep tags locally that are remote
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