removing ALL tags from a git repository

Posted: 7 September 2016 in Teamsite

At the moment, I’m playing with the release plugins in a sandbox project and it’s created lots of tags. I want to start afresh, so I’ve written a little utility to get rid of all the tags

git tag --list | xargs -I {} git tag -d {}
git fsck --unreachable 2>&1 | grep 'unreachable tag' | awk {'print $3'} | xargs git show | grep ^tag | awk {'print $2'} | xargs -I {} git push origin :refs/tags/{}

(2 years since the last post, … shocking 😀 )

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s