Skip to content

Instantly share code, notes, and snippets.

@loburets
Created February 4, 2020 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loburets/d44fa19246f3990651acbc039cce9029 to your computer and use it in GitHub Desktop.
Save loburets/d44fa19246f3990651acbc039cce9029 to your computer and use it in GitHub Desktop.
Remove git tags which don't satisfy regexp
#!/bin/bash
TAGS=''
REFS=''
for i in $( git tag -l | grep -E '^[0-9]{2}-[0-9]{2}' );
do
TAGS+=" ${i}"
REFS+=" :${i}"
done
echo $TAGS
echo $REFS
git tag -d $TAGS
git push origin $REFS --no-verify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment