Skip to content

Instantly share code, notes, and snippets.

@nurrony
Last active March 2, 2020 20:41
Show Gist options
  • Select an option

  • Save nurrony/7caeb491396298fcff019e2bfc350c3c to your computer and use it in GitHub Desktop.

Select an option

Save nurrony/7caeb491396298fcff019e2bfc350c3c to your computer and use it in GitHub Desktop.
Remove all git tags from local and remote
#!/usr/bin/env bash
git filter-branch --index-filter "git rm --cached --ignore-unmatch $1" -- --all
rm -Rf .git/refs/original
rm -Rf .git/logs/
git gc --aggressive --prune=now
#!/usr/bin/env bash
#Delete local tags.
git tag -d $(git tag -l)
#Fetch remote tags.
git fetch
#Delete remote tags.
git push origin --delete $(git tag -l) # Pushing once should be faster than multiple times
#Delete local tags.
git tag -d $(git tag -l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment