1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.4.5" />
7 <title>git-tag(
1)
</title>
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.5em;
116 margin-bottom: 1.5em;
118 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
119 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
120 div
.admonitionblock
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
245 list-style-type: upper-roman
;
248 div
.compact ul
, div
.compact ol
,
249 div
.compact p
, div
.compact p
,
250 div
.compact div
, div
.compact div
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
275 div
.tableblock
> table
[frame
="hsides"] {
276 border-left-style: none
;
277 border-right-style: none
;
279 div
.tableblock
> table
[frame
="vsides"] {
280 border-top-style: none
;
281 border-bottom-style: none
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-tag(
1) Manual Page
409 <div class=
"sectionbody">
411 Create, list, delete or verify a tag object signed with GPG
415 <h2 id=
"_synopsis">SYNOPSIS
</h2>
416 <div class=
"sectionbody">
417 <div class=
"verseblock">
418 <div class=
"verseblock-content"><em>git tag
</em> [-a | -s | -u
<key-id
>] [-f] [-m
<msg
> | -F
<file
>]
419 <tagname
> [
<commit
> |
<object
>]
420 <em>git tag
</em> -d
<tagname
>…
421 <em>git tag
</em> [-n[
<num
>]] -l [--contains
<commit
>] [
<pattern
>]
422 <em>git tag
</em> -v
<tagname
>…</div>
423 <div class=
"verseblock-attribution">
426 <h2 id=
"_description">DESCRIPTION
</h2>
427 <div class=
"sectionbody">
428 <div class=
"paragraph"><p>Adds a tag reference in
<tt>.git/refs/tags/
</tt>.
</p></div>
429 <div class=
"paragraph"><p>Unless
<tt>-f
</tt> is given, the tag must not yet exist in
430 <tt>.git/refs/tags/
</tt> directory.
</p></div>
431 <div class=
"paragraph"><p>If one of
<tt>-a
</tt>,
<tt>-s
</tt>, or
<tt>-u
<key-id
></tt> is passed, the command
432 creates a
<em>tag
</em> object, and requires the tag message. Unless
433 <tt>-m
<msg
></tt> or
<tt>-F
<file
></tt> is given, an editor is started for the user to type
434 in the tag message.
</p></div>
435 <div class=
"paragraph"><p>If
<tt>-m
<msg
></tt> or
<tt>-F
<file
></tt> is given and
<tt>-a
</tt>,
<tt>-s
</tt>, and
<tt>-u
<key-id
></tt>
436 are absent,
<tt>-a
</tt> is implied.
</p></div>
437 <div class=
"paragraph"><p>Otherwise just the SHA1 object name of the commit object is
438 written (i.e. a lightweight tag).
</p></div>
439 <div class=
"paragraph"><p>A GnuPG signed tag object will be created when
<tt>-s
</tt> or
<tt>-u
440 <key-id
></tt> is used. When
<tt>-u
<key-id
></tt> is not used, the
441 committer identity for the current user is used to find the
442 GnuPG key for signing.
</p></div>
444 <h2 id=
"_options">OPTIONS
</h2>
445 <div class=
"sectionbody">
446 <div class=
"dlist"><dl>
452 Make an unsigned, annotated tag object
460 Make a GPG-signed tag, using the default e-mail address
’s key
468 Make a GPG-signed tag, using the given key
479 Replace an existing tag with the given name (instead of failing)
487 Delete existing tags with the given names.
495 Verify the gpg signature of the given tag names.
503 <num
> specifies how many lines from the annotation, if any,
504 are printed when using -l.
505 The default is not to print any annotation lines.
506 If no number is given to
<tt>-n
</tt>, only the first line is printed.
507 If the tag is not annotated, the commit message is displayed instead.
515 List tags with names that match the given pattern (or all if no pattern is given).
516 Typing
"git tag" without arguments, also lists all tags.
520 --contains
<commit
>
524 Only list tags which contain the specified commit.
532 Use the given tag message (instead of prompting).
533 If multiple
<tt>-m
</tt> options are given, their values are
534 concatenated as separate paragraphs.
535 Implies
<tt>-a
</tt> if none of
<tt>-a
</tt>,
<tt>-s
</tt>, or
<tt>-u
<key-id
></tt>
544 Take the tag message from the given file. Use
<em>-
</em> to
545 read the message from the standard input.
546 Implies
<tt>-a
</tt> if none of
<tt>-a
</tt>,
<tt>-s
</tt>, or
<tt>-u
<key-id
></tt>
555 The name of the tag to create, delete, or describe.
556 The new tag name must pass all checks defined by
557 <a href=
"git-check-ref-format.html">git-check-ref-format(
1)
</a>. Some of these checks
558 may restrict the characters allowed in a tag name.
563 <h2 id=
"_configuration">CONFIGURATION
</h2>
564 <div class=
"sectionbody">
565 <div class=
"paragraph"><p>By default,
<em>git tag
</em> in sign-with-default mode (-s) will use your
566 committer identity (of the form
"Your Name <<a href="mailto:your@email.address
">your@email.address</a>>") to
567 find a key. If you want to use a different default key, you can specify
568 it in the repository configuration as follows:
</p></div>
569 <div class=
"listingblock">
570 <div class=
"content">
572 signingkey =
<gpg-key-id
></tt></pre>
575 <h2 id=
"_discussion">DISCUSSION
</h2>
576 <div class=
"sectionbody">
577 <h3 id=
"_on_re_tagging">On Re-tagging
</h3><div style=
"clear:left"></div>
578 <div class=
"paragraph"><p>What should you do when you tag a wrong commit and you would
579 want to re-tag?
</p></div>
580 <div class=
"paragraph"><p>If you never pushed anything out, just re-tag it. Use
"-f" to
581 replace the old one. And you
’re done.
</p></div>
582 <div class=
"paragraph"><p>But if you have pushed things out (or others could just read
583 your repository directly), then others will have already seen
584 the old tag. In that case you can do one of two things:
</p></div>
585 <div class=
"olist arabic"><ol class=
"arabic">
589 Just admit you screwed up, and use a different name. Others have
590 already seen one tag-name, and if you keep the same name, you
591 may be in the situation that two people both have
"version X",
592 but they actually have
<em>different
</em> "X"'s. So just call it
"X.1"
599 You really want to call the new version
"X" too,
<em>even though
</em>
600 others have already seen the old one. So just use
<em>git tag -f
</em>
601 again, as if you hadn
’t already published the old one.
605 <div class=
"paragraph"><p>However, Git does
<strong>not
</strong> (and it should not) change tags behind
606 users back. So if somebody already got the old tag, doing a
607 <em>git pull
</em> on your tree shouldn
’t just make them overwrite the old
609 <div class=
"paragraph"><p>If somebody got a release tag from you, you cannot just change
610 the tag for them by updating your own one. This is a big
611 security issue, in that people MUST be able to trust their
612 tag-names. If you really want to do the insane thing, you need
613 to just fess up to it, and tell people that you messed up. You
614 can do that by making a very public announcement saying:
</p></div>
615 <div class=
"listingblock">
616 <div class=
"content">
617 <pre><tt>Ok, I messed up, and I pushed out an earlier version tagged as X. I
618 then fixed something, and retagged the *fixed* tree as X again.
620 If you got the wrong tag, and want the new one, please delete
621 the old one and fetch the new one by doing:
624 git fetch origin tag X
626 to get my updated tag.
628 You can test which tag you have by doing
632 which should return
0123456789abcdef.. if you have the new version.
634 Sorry for inconvenience.
</tt></pre>
636 <div class=
"paragraph"><p>Does this seem a bit complicated? It
<strong>should
</strong> be. There is no
637 way that it would be correct to just
"fix" it behind peoples
638 backs. People need to know that their tags might have been
640 <h3 id=
"_on_automatic_following">On Automatic following
</h3><div style=
"clear:left"></div>
641 <div class=
"paragraph"><p>If you are following somebody else
’s tree, you are most likely
642 using remote-tracking branches (
<tt>refs/heads/origin
</tt> in traditional
643 layout, or
<tt>refs/remotes/origin/master
</tt> in the separate-remote
644 layout). You usually want the tags from the other end.
</p></div>
645 <div class=
"paragraph"><p>On the other hand, if you are fetching because you would want a
646 one-shot merge from somebody else, you typically do not want to
647 get tags from there. This happens more often for people near
648 the toplevel but not limited to them. Mere mortals when pulling
649 from each other do not necessarily want to automatically get
650 private anchor point tags from the other person.
</p></div>
651 <div class=
"paragraph"><p>You would notice
"please pull" messages on the mailing list says
652 repo URL and branch name alone. This is designed to be easily
653 cut
&pasted to a
<em>git fetch
</em> command line:
</p></div>
654 <div class=
"listingblock">
655 <div class=
"content">
656 <pre><tt>Linus, please pull from
658 git://git..../proj.git master
660 to get the following updates...
</tt></pre>
662 <div class=
"paragraph"><p>becomes:
</p></div>
663 <div class=
"listingblock">
664 <div class=
"content">
665 <pre><tt>$ git pull git://git..../proj.git master
</tt></pre>
667 <div class=
"paragraph"><p>In such a case, you do not want to automatically follow other
’s
669 <div class=
"paragraph"><p>One important aspect of git is it is distributed, and being
670 distributed largely means there is no inherent
"upstream" or
671 "downstream" in the system. On the face of it, the above
672 example might seem to indicate that the tag namespace is owned
673 by upper echelon of people and tags only flow downwards, but
674 that is not the case. It only shows that the usage pattern
675 determines who are interested in whose tags.
</p></div>
676 <div class=
"paragraph"><p>A one-shot pull is a sign that a commit history is now crossing
677 the boundary between one circle of people (e.g.
"people who are
678 primarily interested in the networking part of the kernel") who may
679 have their own set of tags (e.g.
"this is the third release
680 candidate from the networking group to be proposed for general
681 consumption with 2.6.21 release") to another circle of people
682 (e.g.
"people who integrate various subsystem improvements").
683 The latter are usually not interested in the detailed tags used
684 internally in the former group (that is what
"internal" means).
685 That is why it is desirable not to follow tags automatically in
687 <div class=
"paragraph"><p>It may well be that among networking people, they may want to
688 exchange the tags internal to their group, but in that workflow
689 they are most likely tracking with each other
’s progress by
690 having remote-tracking branches. Again, the heuristic to automatically
691 follow such tags is a good thing.
</p></div>
692 <h3 id=
"_on_backdating_tags">On Backdating Tags
</h3><div style=
"clear:left"></div>
693 <div class=
"paragraph"><p>If you have imported some changes from another VCS and would like
694 to add tags for major releases of your work, it is useful to be able
695 to specify the date to embed inside of the tag object. The data in
696 the tag object affects, for example, the ordering of tags in the
697 gitweb interface.
</p></div>
698 <div class=
"paragraph"><p>To set the date used in future tag objects, set the environment
699 variable GIT_COMMITTER_DATE to one or more of the date and time. The
700 date and time can be specified in a number of ways; the most common
701 is
"YYYY-MM-DD HH:MM".
</p></div>
702 <div class=
"paragraph"><p>An example follows.
</p></div>
703 <div class=
"listingblock">
704 <div class=
"content">
705 <pre><tt>$
GIT_COMMITTER_DATE=
"2006-10-02 10:31" git tag -s v1.0
.1</tt></pre>
708 <h2 id=
"_see_also">SEE ALSO
</h2>
709 <div class=
"sectionbody">
710 <div class=
"paragraph"><p><a href=
"git-check-ref-format.html">git-check-ref-format(
1)
</a>.
</p></div>
712 <h2 id=
"_author">Author
</h2>
713 <div class=
"sectionbody">
714 <div class=
"paragraph"><p>Written by Linus Torvalds
<<a href=
"mailto:torvalds@osdl.org">torvalds@osdl.org
</a>>,
715 Junio C Hamano
<<a href=
"mailto:gitster@pobox.com">gitster@pobox.com
</a>> and Chris Wright
<<a href=
"mailto:chrisw@osdl.org">chrisw@osdl.org
</a>>.
</p></div>
717 <h2 id=
"_documentation">Documentation
</h2>
718 <div class=
"sectionbody">
719 <div class=
"paragraph"><p>Documentation by David Greaves, Junio C Hamano and the git-list
<<a href=
"mailto:git@vger.kernel.org">git@vger.kernel.org
</a>>.
</p></div>
721 <h2 id=
"_git">GIT
</h2>
722 <div class=
"sectionbody">
723 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
726 <div id=
"footer-text">
727 Last updated
2010-
11-
25 03:
13:
43 UTC