devroom.io/content/blog/2009-09-04-git-tag-mini-cheat-sheet.md

32 lines
794 B
Markdown
Raw Normal View History

2015-03-26 11:28:08 +00:00
+++
date = "2009-09-04"
title = "Git Tag Mini Cheat Sheet"
tags = ["git", "cheat sheet", "tags"]
slug = "git-tag-mini-cheat-sheet"
+++
Just as a kind of mini cheat sheet for using git tags:
Adding a tag:
<ul>
<li><code>git tag tag_name</code></li>
<li><code>git tag</code><br />
<em>Should show your new tag.</em></li>
<li><code>git push origin --tags</code> or <code>git push origin :tag_name</code><br />
<em>Because <code>git push</code> doesn't push tags.</em></li>
</ul>
Removing a tag:
<ul>
<li><code>git tag -d tag_name</code></li>
<li><code>git tag</code><br />
<em>Should no longer show your tag.</em></li>
<li><code>git push origin :refs/tags/tag_name</code><br />
<em>Because <code>git push --tags</code> doesn't push deleted tags.</em></li>
</ul>
<!--more-->
Hope that helps.