Skip to content

Instantly share code, notes, and snippets.

@developerdino
Last active May 9, 2017 23:55
Show Gist options
  • Select an option

  • Save developerdino/9fa6646c5e04b54edfc04dc679d08540 to your computer and use it in GitHub Desktop.

Select an option

Save developerdino/9fa6646c5e04b54edfc04dc679d08540 to your computer and use it in GitHub Desktop.
Handy GIT Commands
# remove all tags from origin that end in digits (/[0-9]*)
# remove --dry-run to actually do the deletions
git ls-remote --tags | grep -o 'refs/tags/.*/[0-9]*' |sort -r |xargs git push --dry-run --delete origin
# sync all remote tags with your local repo so you don't push them all back up to the remote
git fetch --prune origin '+refs/tags/*:refs/tags/*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment