Autogenerated HTML docs for v1.7.5.1-339-gb602ed
[git/jnareb-git.git] / git-tag.html
bloba2663f605666a6ad2c42fb4b6a0c38daf527d732
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;]
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 pattern is given).
517 Typing "git tag" without arguments, also lists all tags.
518 </p>
519 </dd>
520 <dt class="hdlist1">
521 --contains &lt;commit&gt;
522 </dt>
523 <dd>
525 Only list tags which contain the specified commit.
526 </p>
527 </dd>
528 <dt class="hdlist1">
529 -m &lt;msg&gt;
530 </dt>
531 <dd>
533 Use the given tag message (instead of prompting).
534 If multiple <tt>-m</tt> options are given, their values are
535 concatenated as separate paragraphs.
536 Implies <tt>-a</tt> if none of <tt>-a</tt>, <tt>-s</tt>, or <tt>-u &lt;key-id&gt;</tt>
537 is given.
538 </p>
539 </dd>
540 <dt class="hdlist1">
541 -F &lt;file&gt;
542 </dt>
543 <dd>
545 Take the tag message from the given file. Use <em>-</em> to
546 read the message from the standard input.
547 Implies <tt>-a</tt> if none of <tt>-a</tt>, <tt>-s</tt>, or <tt>-u &lt;key-id&gt;</tt>
548 is given.
549 </p>
550 </dd>
551 <dt class="hdlist1">
552 &lt;tagname&gt;
553 </dt>
554 <dd>
556 The name of the tag to create, delete, or describe.
557 The new tag name must pass all checks defined by
558 <a href="git-check-ref-format.html">git-check-ref-format(1)</a>. Some of these checks
559 may restrict the characters allowed in a tag name.
560 </p>
561 </dd>
562 </dl></div>
563 </div>
564 <h2 id="_configuration">CONFIGURATION</h2>
565 <div class="sectionbody">
566 <div class="paragraph"><p>By default, <em>git tag</em> in sign-with-default mode (-s) will use your
567 committer identity (of the form "Your Name &lt;<a href="mailto:your@email.address">your@email.address</a>&gt;") to
568 find a key. If you want to use a different default key, you can specify
569 it in the repository configuration as follows:</p></div>
570 <div class="listingblock">
571 <div class="content">
572 <pre><tt>[user]
573 signingkey = &lt;gpg-key-id&gt;</tt></pre>
574 </div></div>
575 </div>
576 <h2 id="_discussion">DISCUSSION</h2>
577 <div class="sectionbody">
578 <h3 id="_on_re_tagging">On Re-tagging</h3><div style="clear:left"></div>
579 <div class="paragraph"><p>What should you do when you tag a wrong commit and you would
580 want to re-tag?</p></div>
581 <div class="paragraph"><p>If you never pushed anything out, just re-tag it. Use "-f" to
582 replace the old one. And you&#8217;re done.</p></div>
583 <div class="paragraph"><p>But if you have pushed things out (or others could just read
584 your repository directly), then others will have already seen
585 the old tag. In that case you can do one of two things:</p></div>
586 <div class="olist arabic"><ol class="arabic">
587 <li>
589 The sane thing.
590 Just admit you screwed up, and use a different name. Others have
591 already seen one tag-name, and if you keep the same name, you
592 may be in the situation that two people both have "version X",
593 but they actually have <em>different</em> "X"'s. So just call it "X.1"
594 and be done with it.
595 </p>
596 </li>
597 <li>
599 The insane thing.
600 You really want to call the new version "X" too, <em>even though</em>
601 others have already seen the old one. So just use <em>git tag -f</em>
602 again, as if you hadn&#8217;t already published the old one.
603 </p>
604 </li>
605 </ol></div>
606 <div class="paragraph"><p>However, Git does <strong>not</strong> (and it should not) change tags behind
607 users back. So if somebody already got the old tag, doing a
608 <em>git pull</em> on your tree shouldn&#8217;t just make them overwrite the old
609 one.</p></div>
610 <div class="paragraph"><p>If somebody got a release tag from you, you cannot just change
611 the tag for them by updating your own one. This is a big
612 security issue, in that people MUST be able to trust their
613 tag-names. If you really want to do the insane thing, you need
614 to just fess up to it, and tell people that you messed up. You
615 can do that by making a very public announcement saying:</p></div>
616 <div class="listingblock">
617 <div class="content">
618 <pre><tt>Ok, I messed up, and I pushed out an earlier version tagged as X. I
619 then fixed something, and retagged the *fixed* tree as X again.
621 If you got the wrong tag, and want the new one, please delete
622 the old one and fetch the new one by doing:
624 git tag -d X
625 git fetch origin tag X
627 to get my updated tag.
629 You can test which tag you have by doing
631 git rev-parse X
633 which should return 0123456789abcdef.. if you have the new version.
635 Sorry for the inconvenience.</tt></pre>
636 </div></div>
637 <div class="paragraph"><p>Does this seem a bit complicated? It <strong>should</strong> be. There is no
638 way that it would be correct to just "fix" it automatically.
639 People need to know that their tags might have been changed.</p></div>
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&#8217;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>Often, "please pull" messages on the mailing list just provide
652 two pieces of information: a repo URL and a branch name; this
653 is designed to be easily cut&amp;pasted at the end of a <em>git fetch</em>
654 command line:</p></div>
655 <div class="listingblock">
656 <div class="content">
657 <pre><tt>Linus, please pull from
659 git://git..../proj.git master
661 to get the following updates...</tt></pre>
662 </div></div>
663 <div class="paragraph"><p>becomes:</p></div>
664 <div class="listingblock">
665 <div class="content">
666 <pre><tt>$ git pull git://git..../proj.git master</tt></pre>
667 </div></div>
668 <div class="paragraph"><p>In such a case, you do not want to automatically follow the other
669 person&#8217;s tags.</p></div>
670 <div class="paragraph"><p>One important aspect of git is its distributed nature, which
671 largely means there is no inherent "upstream" or
672 "downstream" in the system. On the face of it, the above
673 example might seem to indicate that the tag namespace is owned
674 by the upper echelon of people and that tags only flow downwards, but
675 that is not the case. It only shows that the usage pattern
676 determines who are interested in whose tags.</p></div>
677 <div class="paragraph"><p>A one-shot pull is a sign that a commit history is now crossing
678 the boundary between one circle of people (e.g. "people who are
679 primarily interested in the networking part of the kernel") who may
680 have their own set of tags (e.g. "this is the third release
681 candidate from the networking group to be proposed for general
682 consumption with 2.6.21 release") to another circle of people
683 (e.g. "people who integrate various subsystem improvements").
684 The latter are usually not interested in the detailed tags used
685 internally in the former group (that is what "internal" means).
686 That is why it is desirable not to follow tags automatically in
687 this case.</p></div>
688 <div class="paragraph"><p>It may well be that among networking people, they may want to
689 exchange the tags internal to their group, but in that workflow
690 they are most likely tracking each other&#8217;s progress by
691 having remote-tracking branches. Again, the heuristic to automatically
692 follow such tags is a good thing.</p></div>
693 <h3 id="_on_backdating_tags">On Backdating Tags</h3><div style="clear:left"></div>
694 <div class="paragraph"><p>If you have imported some changes from another VCS and would like
695 to add tags for major releases of your work, it is useful to be able
696 to specify the date to embed inside of the tag object; such data in
697 the tag object affects, for example, the ordering of tags in the
698 gitweb interface.</p></div>
699 <div class="paragraph"><p>To set the date used in future tag objects, set the environment
700 variable GIT_COMMITTER_DATE (see the later discussion of possible
701 values; the most common form is "YYYY-MM-DD HH:MM").</p></div>
702 <div class="paragraph"><p>For example:</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>
706 </div></div>
707 </div>
708 <h2 id="_date_formats">DATE FORMATS</h2>
709 <div class="sectionbody">
710 <div class="paragraph"><p>The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables
711 support the following date formats:</p></div>
712 <div class="dlist"><dl>
713 <dt class="hdlist1">
714 Git internal format
715 </dt>
716 <dd>
718 It is <tt>&lt;unix timestamp&gt; &lt;timezone offset&gt;</tt>, where <tt>&lt;unix
719 timestamp&gt;</tt> is the number of seconds since the UNIX epoch.
720 <tt>&lt;timezone offset&gt;</tt> is a positive or negative offset from UTC.
721 For example CET (which is 2 hours ahead UTC) is <tt>+0200</tt>.
722 </p>
723 </dd>
724 <dt class="hdlist1">
725 RFC 2822
726 </dt>
727 <dd>
729 The standard email format as described by RFC 2822, for example
730 <tt>Thu, 07 Apr 2005 22:13:13 +0200</tt>.
731 </p>
732 </dd>
733 <dt class="hdlist1">
734 ISO 8601
735 </dt>
736 <dd>
738 Time and date specified by the ISO 8601 standard, for example
739 <tt>2005-04-07T22:13:13</tt>. The parser accepts a space instead of the
740 <tt>T</tt> character as well.
741 </p>
742 <div class="admonitionblock">
743 <table><tr>
744 <td class="icon">
745 <div class="title">Note</div>
746 </td>
747 <td class="content">In addition, the date part is accepted in the following formats:
748 <tt>YYYY.MM.DD</tt>, <tt>MM/DD/YYYY</tt> and <tt>DD.MM.YYYY</tt>.</td>
749 </tr></table>
750 </div>
751 </dd>
752 </dl></div>
753 </div>
754 <h2 id="_see_also">SEE ALSO</h2>
755 <div class="sectionbody">
756 <div class="paragraph"><p><a href="git-check-ref-format.html">git-check-ref-format(1)</a>.</p></div>
757 </div>
758 <h2 id="_git">GIT</h2>
759 <div class="sectionbody">
760 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
761 </div>
762 <div id="footer">
763 <div id="footer-text">
764 Last updated 2011-03-29 06:53:36 UTC
765 </div>
766 </div>
767 </body>
768 </html>