Autogenerated HTML docs for v1.7.6-396-ge0613
[git/jnareb-git.git] / git-tag.html
blob4717ec7e6bd2ebf1c8aeef06b805f9f88749c091
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">
4 <head>
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">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.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 {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
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 {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
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;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-tag(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-tag -
411 Create, list, delete or verify a tag object signed with GPG
412 </p>
413 </div>
414 </div>
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 &lt;key-id&gt;] [-f] [-m &lt;msg&gt; | -F &lt;file&gt;]
419 &lt;tagname&gt; [&lt;commit&gt; | &lt;object&gt;]
420 <em>git tag</em> -d &lt;tagname&gt;&#8230;
421 <em>git tag</em> [-n[&lt;num&gt;]] -l [--contains &lt;commit&gt;] [&lt;pattern&gt;&#8230;]
422 <em>git tag</em> -v &lt;tagname&gt;&#8230;</div>
423 <div class="verseblock-attribution">
424 </div></div>
425 </div>
426 <h2 id="_description">DESCRIPTION</h2>
427 <div class="sectionbody">
428 <div class="paragraph"><p>Add a tag reference in <tt>.git/refs/tags/</tt>, unless <tt>-d/-l/-v</tt> is given
429 to delete, list or verify tags.</p></div>
430 <div class="paragraph"><p>Unless <tt>-f</tt> is given, the tag to be created must not yet exist in the
431 <tt>.git/refs/tags/</tt> directory.</p></div>
432 <div class="paragraph"><p>If one of <tt>-a</tt>, <tt>-s</tt>, or <tt>-u &lt;key-id&gt;</tt> is passed, the command
433 creates a <em>tag</em> object, and requires a tag message. Unless
434 <tt>-m &lt;msg&gt;</tt> or <tt>-F &lt;file&gt;</tt> is given, an editor is started for the user to type
435 in the tag message.</p></div>
436 <div class="paragraph"><p>If <tt>-m &lt;msg&gt;</tt> or <tt>-F &lt;file&gt;</tt> is given and <tt>-a</tt>, <tt>-s</tt>, and <tt>-u &lt;key-id&gt;</tt>
437 are absent, <tt>-a</tt> is implied.</p></div>
438 <div class="paragraph"><p>Otherwise just a tag reference for the SHA1 object name of the commit object is
439 created (i.e. a lightweight tag).</p></div>
440 <div class="paragraph"><p>A GnuPG signed tag object will be created when <tt>-s</tt> or <tt>-u
441 &lt;key-id&gt;</tt> is used. When <tt>-u &lt;key-id&gt;</tt> is not used, the
442 committer identity for the current user is used to find the
443 GnuPG key for signing.</p></div>
444 </div>
445 <h2 id="_options">OPTIONS</h2>
446 <div class="sectionbody">
447 <div class="dlist"><dl>
448 <dt class="hdlist1">
450 </dt>
451 <dd>
453 Make an unsigned, annotated tag object
454 </p>
455 </dd>
456 <dt class="hdlist1">
458 </dt>
459 <dd>
461 Make a GPG-signed tag, using the default e-mail address&#8217;s key
462 </p>
463 </dd>
464 <dt class="hdlist1">
465 -u &lt;key-id&gt;
466 </dt>
467 <dd>
469 Make a GPG-signed tag, using the given key
470 </p>
471 </dd>
472 <dt class="hdlist1">
474 </dt>
475 <dt class="hdlist1">
476 --force
477 </dt>
478 <dd>
480 Replace an existing tag with the given name (instead of failing)
481 </p>
482 </dd>
483 <dt class="hdlist1">
485 </dt>
486 <dd>
488 Delete existing tags with the given names.
489 </p>
490 </dd>
491 <dt class="hdlist1">
493 </dt>
494 <dd>
496 Verify the gpg signature of the given tag names.
497 </p>
498 </dd>
499 <dt class="hdlist1">
500 -n&lt;num&gt;
501 </dt>
502 <dd>
504 &lt;num&gt; specifies how many lines from the annotation, if any,
505 are printed when using -l.
506 The default is not to print any annotation lines.
507 If no number is given to <tt>-n</tt>, only the first line is printed.
508 If the tag is not annotated, the commit message is displayed instead.
509 </p>
510 </dd>
511 <dt class="hdlist1">
512 -l &lt;pattern&gt;
513 </dt>
514 <dd>
516 List tags with names that match the given pattern (or all if no
517 pattern is given). Running "git tag" without arguments also
518 lists all tags. The pattern is a shell wildcard (i.e., matched
519 using fnmatch(3)). Multiple patterns may be given; if any of
520 them matches, the tag is shown.
521 </p>
522 </dd>
523 <dt class="hdlist1">
524 --contains &lt;commit&gt;
525 </dt>
526 <dd>
528 Only list tags which contain the specified commit.
529 </p>
530 </dd>
531 <dt class="hdlist1">
532 -m &lt;msg&gt;
533 </dt>
534 <dd>
536 Use the given tag message (instead of prompting).
537 If multiple <tt>-m</tt> options are given, their values are
538 concatenated as separate paragraphs.
539 Implies <tt>-a</tt> if none of <tt>-a</tt>, <tt>-s</tt>, or <tt>-u &lt;key-id&gt;</tt>
540 is given.
541 </p>
542 </dd>
543 <dt class="hdlist1">
544 -F &lt;file&gt;
545 </dt>
546 <dd>
548 Take the tag message from the given file. Use <em>-</em> to
549 read the message from the standard input.
550 Implies <tt>-a</tt> if none of <tt>-a</tt>, <tt>-s</tt>, or <tt>-u &lt;key-id&gt;</tt>
551 is given.
552 </p>
553 </dd>
554 <dt class="hdlist1">
555 &lt;tagname&gt;
556 </dt>
557 <dd>
559 The name of the tag to create, delete, or describe.
560 The new tag name must pass all checks defined by
561 <a href="git-check-ref-format.html">git-check-ref-format(1)</a>. Some of these checks
562 may restrict the characters allowed in a tag name.
563 </p>
564 </dd>
565 </dl></div>
566 </div>
567 <h2 id="_configuration">CONFIGURATION</h2>
568 <div class="sectionbody">
569 <div class="paragraph"><p>By default, <em>git tag</em> in sign-with-default mode (-s) will use your
570 committer identity (of the form "Your Name &lt;<a href="mailto:your@email.address">your@email.address</a>&gt;") to
571 find a key. If you want to use a different default key, you can specify
572 it in the repository configuration as follows:</p></div>
573 <div class="listingblock">
574 <div class="content">
575 <pre><tt>[user]
576 signingkey = &lt;gpg-key-id&gt;</tt></pre>
577 </div></div>
578 </div>
579 <h2 id="_discussion">DISCUSSION</h2>
580 <div class="sectionbody">
581 <h3 id="_on_re_tagging">On Re-tagging</h3><div style="clear:left"></div>
582 <div class="paragraph"><p>What should you do when you tag a wrong commit and you would
583 want to re-tag?</p></div>
584 <div class="paragraph"><p>If you never pushed anything out, just re-tag it. Use "-f" to
585 replace the old one. And you&#8217;re done.</p></div>
586 <div class="paragraph"><p>But if you have pushed things out (or others could just read
587 your repository directly), then others will have already seen
588 the old tag. In that case you can do one of two things:</p></div>
589 <div class="olist arabic"><ol class="arabic">
590 <li>
592 The sane thing.
593 Just admit you screwed up, and use a different name. Others have
594 already seen one tag-name, and if you keep the same name, you
595 may be in the situation that two people both have "version X",
596 but they actually have <em>different</em> "X"'s. So just call it "X.1"
597 and be done with it.
598 </p>
599 </li>
600 <li>
602 The insane thing.
603 You really want to call the new version "X" too, <em>even though</em>
604 others have already seen the old one. So just use <em>git tag -f</em>
605 again, as if you hadn&#8217;t already published the old one.
606 </p>
607 </li>
608 </ol></div>
609 <div class="paragraph"><p>However, Git does <strong>not</strong> (and it should not) change tags behind
610 users back. So if somebody already got the old tag, doing a
611 <em>git pull</em> on your tree shouldn&#8217;t just make them overwrite the old
612 one.</p></div>
613 <div class="paragraph"><p>If somebody got a release tag from you, you cannot just change
614 the tag for them by updating your own one. This is a big
615 security issue, in that people MUST be able to trust their
616 tag-names. If you really want to do the insane thing, you need
617 to just fess up to it, and tell people that you messed up. You
618 can do that by making a very public announcement saying:</p></div>
619 <div class="listingblock">
620 <div class="content">
621 <pre><tt>Ok, I messed up, and I pushed out an earlier version tagged as X. I
622 then fixed something, and retagged the *fixed* tree as X again.
624 If you got the wrong tag, and want the new one, please delete
625 the old one and fetch the new one by doing:
627 git tag -d X
628 git fetch origin tag X
630 to get my updated tag.
632 You can test which tag you have by doing
634 git rev-parse X
636 which should return 0123456789abcdef.. if you have the new version.
638 Sorry for the inconvenience.</tt></pre>
639 </div></div>
640 <div class="paragraph"><p>Does this seem a bit complicated? It <strong>should</strong> be. There is no
641 way that it would be correct to just "fix" it automatically.
642 People need to know that their tags might have been changed.</p></div>
643 <h3 id="_on_automatic_following">On Automatic following</h3><div style="clear:left"></div>
644 <div class="paragraph"><p>If you are following somebody else&#8217;s tree, you are most likely
645 using remote-tracking branches (<tt>refs/heads/origin</tt> in traditional
646 layout, or <tt>refs/remotes/origin/master</tt> in the separate-remote
647 layout). You usually want the tags from the other end.</p></div>
648 <div class="paragraph"><p>On the other hand, if you are fetching because you would want a
649 one-shot merge from somebody else, you typically do not want to
650 get tags from there. This happens more often for people near
651 the toplevel but not limited to them. Mere mortals when pulling
652 from each other do not necessarily want to automatically get
653 private anchor point tags from the other person.</p></div>
654 <div class="paragraph"><p>Often, "please pull" messages on the mailing list just provide
655 two pieces of information: a repo URL and a branch name; this
656 is designed to be easily cut&amp;pasted at the end of a <em>git fetch</em>
657 command line:</p></div>
658 <div class="listingblock">
659 <div class="content">
660 <pre><tt>Linus, please pull from
662 git://git..../proj.git master
664 to get the following updates...</tt></pre>
665 </div></div>
666 <div class="paragraph"><p>becomes:</p></div>
667 <div class="listingblock">
668 <div class="content">
669 <pre><tt>$ git pull git://git..../proj.git master</tt></pre>
670 </div></div>
671 <div class="paragraph"><p>In such a case, you do not want to automatically follow the other
672 person&#8217;s tags.</p></div>
673 <div class="paragraph"><p>One important aspect of git is its distributed nature, which
674 largely means there is no inherent "upstream" or
675 "downstream" in the system. On the face of it, the above
676 example might seem to indicate that the tag namespace is owned
677 by the upper echelon of people and that tags only flow downwards, but
678 that is not the case. It only shows that the usage pattern
679 determines who are interested in whose tags.</p></div>
680 <div class="paragraph"><p>A one-shot pull is a sign that a commit history is now crossing
681 the boundary between one circle of people (e.g. "people who are
682 primarily interested in the networking part of the kernel") who may
683 have their own set of tags (e.g. "this is the third release
684 candidate from the networking group to be proposed for general
685 consumption with 2.6.21 release") to another circle of people
686 (e.g. "people who integrate various subsystem improvements").
687 The latter are usually not interested in the detailed tags used
688 internally in the former group (that is what "internal" means).
689 That is why it is desirable not to follow tags automatically in
690 this case.</p></div>
691 <div class="paragraph"><p>It may well be that among networking people, they may want to
692 exchange the tags internal to their group, but in that workflow
693 they are most likely tracking each other&#8217;s progress by
694 having remote-tracking branches. Again, the heuristic to automatically
695 follow such tags is a good thing.</p></div>
696 <h3 id="_on_backdating_tags">On Backdating Tags</h3><div style="clear:left"></div>
697 <div class="paragraph"><p>If you have imported some changes from another VCS and would like
698 to add tags for major releases of your work, it is useful to be able
699 to specify the date to embed inside of the tag object; such data in
700 the tag object affects, for example, the ordering of tags in the
701 gitweb interface.</p></div>
702 <div class="paragraph"><p>To set the date used in future tag objects, set the environment
703 variable GIT_COMMITTER_DATE (see the later discussion of possible
704 values; the most common form is "YYYY-MM-DD HH:MM").</p></div>
705 <div class="paragraph"><p>For example:</p></div>
706 <div class="listingblock">
707 <div class="content">
708 <pre><tt>$ GIT_COMMITTER_DATE="2006-10-02 10:31" git tag -s v1.0.1</tt></pre>
709 </div></div>
710 </div>
711 <h2 id="_date_formats">DATE FORMATS</h2>
712 <div class="sectionbody">
713 <div class="paragraph"><p>The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables
714 support the following date formats:</p></div>
715 <div class="dlist"><dl>
716 <dt class="hdlist1">
717 Git internal format
718 </dt>
719 <dd>
721 It is <tt>&lt;unix timestamp&gt; &lt;timezone offset&gt;</tt>, where <tt>&lt;unix
722 timestamp&gt;</tt> is the number of seconds since the UNIX epoch.
723 <tt>&lt;timezone offset&gt;</tt> is a positive or negative offset from UTC.
724 For example CET (which is 2 hours ahead UTC) is <tt>+0200</tt>.
725 </p>
726 </dd>
727 <dt class="hdlist1">
728 RFC 2822
729 </dt>
730 <dd>
732 The standard email format as described by RFC 2822, for example
733 <tt>Thu, 07 Apr 2005 22:13:13 +0200</tt>.
734 </p>
735 </dd>
736 <dt class="hdlist1">
737 ISO 8601
738 </dt>
739 <dd>
741 Time and date specified by the ISO 8601 standard, for example
742 <tt>2005-04-07T22:13:13</tt>. The parser accepts a space instead of the
743 <tt>T</tt> character as well.
744 </p>
745 <div class="admonitionblock">
746 <table><tr>
747 <td class="icon">
748 <div class="title">Note</div>
749 </td>
750 <td class="content">In addition, the date part is accepted in the following formats:
751 <tt>YYYY.MM.DD</tt>, <tt>MM/DD/YYYY</tt> and <tt>DD.MM.YYYY</tt>.</td>
752 </tr></table>
753 </div>
754 </dd>
755 </dl></div>
756 </div>
757 <h2 id="_see_also">SEE ALSO</h2>
758 <div class="sectionbody">
759 <div class="paragraph"><p><a href="git-check-ref-format.html">git-check-ref-format(1)</a>.</p></div>
760 </div>
761 <h2 id="_git">GIT</h2>
762 <div class="sectionbody">
763 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
764 </div>
765 <div id="footer">
766 <div id="footer-text">
767 Last updated 2011-07-19 20:01:51 UTC
768 </div>
769 </div>
770 </body>
771 </html>