Managing Tags Git

I use github to manage my personal projects, and I’m assuming this applies to pretty much any instance of git though. I was looking for an easy way to fully manage tags (creating and deleting them particularly). Here’s a good discussion of it on Stackoverflow: http://stackoverflow.com/questions/1841341/remove-local-tags-that-are-no-longer-on-the-remote-repository

The answer that seems easiest to me, and for a better explanation, check the link above is here.

First we will delete all tags from our local repo:

git tag -l | xargs git tag -d

Then I need to delete the tag on my remote branch when I’m doing some cleaning:

git push origin :tag.name

Then you pull in the latest repo, and it will show your tags that haven’t been deleted prior:

git fetch

This is my workflow anyways, I look for this enough, thought I’d put it in my space :) .

About the Author: JeffAncel
http://jeffancel.com
A passionate web developer in St. Louis. Living on the edge with Rails, HTML5, CSS3 and any interesting libraries around. I love to spend time with the family, cook, develop web applications and play with our dragons. When I have nothing else to do, I socialize via twitter (@jancel) and facebook.

Leave a reply

© 2012 - Jeff Ancel
Wordpress Themes
Scroll to Top