Skip to content

Instantly share code, notes, and snippets.

@minuz
Created February 7, 2023 22:40
Show Gist options
  • Select an option

  • Save minuz/b21db908fc02808686865c883500f9f1 to your computer and use it in GitHub Desktop.

Select an option

Save minuz/b21db908fc02808686865c883500f9f1 to your computer and use it in GitHub Desktop.
Clean up git tags
#!/bin/bash
tags=$(git tag -l "*-beta*")
if [ -z "$tags" ]; then
echo "No beta tags found"
exit 0
fi
# Delete all local git tags with the pattern -beta
git tag -d $tags
# Delete all remote git tags with the pattern -beta
git push origin -d $tags
# Fetch all tags from the remote origin
git fetch --all --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment