Skip to content

Instantly share code, notes, and snippets.

@derekgottlieb
Created April 3, 2017 13:31
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 derekgottlieb/f34e3c68a59cfc453a5382fc85693509 to your computer and use it in GitHub Desktop.
Save derekgottlieb/f34e3c68a59cfc453a5382fc85693509 to your computer and use it in GitHub Desktop.
git-nuketag
#!/bin/bash
if [[ -z $1 ]]; then
echo "Usage: git nuketag tag"
exit 1
fi
tag="$1"
count=$(git tag | grep -c "$tag")
if [[ $count -gt 0 ]]; then
echo "About do delete tag $tag. Are you sure? [y/n]"
read prompt
if [[ "$prompt" -eq "y" ]]; then
git tag -d "$tag"
git push origin :refs/tags/"$tag"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment