Created
April 3, 2017 13:31
-
-
Save derekgottlieb/f34e3c68a59cfc453a5382fc85693509 to your computer and use it in GitHub Desktop.
git-nuketag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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