Skip to content

Instantly share code, notes, and snippets.

@pwc3
Last active May 7, 2020 14:54
Show Gist options
  • Save pwc3/28c0afebc055a13c99e5b6a1be73a330 to your computer and use it in GitHub Desktop.
Save pwc3/28c0afebc055a13c99e5b6a1be73a330 to your computer and use it in GitHub Desktop.
Remove Git Tag
#!/usr/bin/env bash
set -euo pipefail
E_BADARGS=85
if [ $# -ne 1 ]; then
echo "Usage: $(basename $0) tag-name"
exit $E_BADARGS
fi
tagname="$1"
# Delete the local tag
echo "Deleting local tag $tagname"
git tag --delete $tagname
# Delete the remote tag
echo "Deleting remote tag $tagname"
git push --delete origin $tagname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment