Skip to content

Instantly share code, notes, and snippets.

@tthyer
Last active May 16, 2020 14:36
Show Gist options
  • Save tthyer/f64cda9ce740fe04b52cd24a21be09ff to your computer and use it in GitHub Desktop.
Save tthyer/f64cda9ce740fe04b52cd24a21be09ff to your computer and use it in GitHub Desktop.
remove all git tags, local and remote
#! /bin/bash
# pass tags as arguments to script
# if no arguments, nothing will be removed
# for example to remove all tags run ./remove-tags.sh $(git tag)
tags=( "$@" )
for i in ${tags[@]}
do
git push --delete origin $i
git tag -d $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment