Skip to content

Instantly share code, notes, and snippets.

@lewkoo
Created July 10, 2020 07:10
Show Gist options
  • Save lewkoo/1145b73e48325908678be7ad3102412c to your computer and use it in GitHub Desktop.
Save lewkoo/1145b73e48325908678be7ad3102412c to your computer and use it in GitHub Desktop.
Remove tags from remote repo that match a certain pattern
#!/bin/bash
tag_names=""
git ls-remote --tags --refs origin |
{
while read old_t; do
tag_names+=":refs/tags/${old_t##*refs/tags/} "
done
git push origin $tag_names
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment