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

34 lines
806 B
Markdown
Raw Normal View History

2013-03-22 22:53:57 +00:00
---
title: "Git Tag Mini Cheat Sheet"
kind: article
slug: git-tag-mini-cheat-sheet
created_at: 2009-09-04
tags:
- git
- cheat sheet
- tags
---
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.