Autogenerated HTML docs for v1.7.4-15-g7811
[git/jnareb-git.git] / git-tag.html
blob367b2aff38acd8c4081542820bc8d82a39ca446a
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>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 &lt;key-id&gt;</tt> is passed, the command
432 creates a <em>tag</em> object, and requires the tag message. Unless
433 <tt>-m &lt;msg&gt;</tt> or <tt>-F &lt;file&gt;</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 &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>
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 &lt;key-id&gt;</tt> is used. When <tt>-u &lt;key-id&gt;</tt> is not used, the
441 committer identity for the current user is used to find the
442 GnuPG key for signing.</p></div>
443 </div>
444 <h2 id="_options">OPTIONS</h2>
445 <div class="sectionbody">
446 <div class="dlist"><dl>
447 <dt class="hdlist1">
449 </dt>
450 <dd>
452 Make an unsigned, annotated tag object
453 </p>
454 </dd>
455 <dt class="hdlist1">
457 </dt>
458 <dd>
460 Make a GPG-signed tag, using the default e-mail address&#8217;s key
461 </p>
462 </dd>
463 <dt class="hdlist1">
464 -u &lt;key-id&gt;
465 </dt>
466 <dd>
468 Make a GPG-signed tag, using the given key
469 </p>
470 </dd>
471 <dt class="hdlist1">
473 </dt>
474 <dt class="hdlist1">
475 --force
476 </dt>
477 <dd>
479 Replace an existing tag with the given name (instead of failing)
480 </p>
481 </dd>
482 <dt class="hdlist1">
484 </dt>
485 <dd>
487 Delete existing tags with the given names.
488 </p>
489 </dd>
490 <dt class="hdlist1">
492 </dt>
493 <dd>
495 Verify the gpg signature of the given tag names.
496 </p>
497 </dd>
498 <dt class="hdlist1">
499 -n&lt;num&gt;
500 </dt>
501 <dd>
503 &lt;num&gt; 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.
508 </p>
509 </dd>
510 <dt class="hdlist1">
511 -l &lt;pattern&gt;
512 </dt>
513 <dd>
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.
517 </p>
518 </dd>
519 <dt class="hdlist1">
520 --contains &lt;commit&gt;
521 </dt>
522 <dd>
524 Only list tags which contain the specified commit.
525 </p>
526 </dd>
527 <dt class="hdlist1">
528 -m &lt;msg&gt;
529 </dt>
530 <dd>
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 &lt;key-id&gt;</tt>
536 is given.
537 </p>
538 </dd>
539 <dt class="hdlist1">
540 -F &lt;file&gt;
541 </dt>
542 <dd>
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 &lt;key-id&gt;</tt>
547 is given.
548 </p>
549 </dd>
550 <dt class="hdlist1">
551 &lt;tagname&gt;
552 </dt>
553 <dd>
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.
559 </p>
560 </dd>
561 </dl></div>
562 </div>
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 &lt;<a href="mailto:your@email.address">your@email.address</a>&gt;") 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">
571 <pre><tt>[user]
572 signingkey = &lt;gpg-key-id&gt;</tt></pre>
573 </div></div>
574 </div>
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&#8217;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">
586 <li>
588 The sane thing.
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"
593 and be done with it.
594 </p>
595 </li>
596 <li>
598 The insane thing.
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&#8217;t already published the old one.
602 </p>
603 </li>
604 </ol></div>
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&#8217;t just make them overwrite the old
608 one.</p></div>
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:
623 git tag -d X
624 git fetch origin tag X
626 to get my updated tag.
628 You can test which tag you have by doing
630 git rev-parse X
632 which should return 0123456789abcdef.. if you have the new version.
634 Sorry for inconvenience.</tt></pre>
635 </div></div>
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
639 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>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&amp;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>
661 </div></div>
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>
666 </div></div>
667 <div class="paragraph"><p>In such a case, you do not want to automatically follow other&#8217;s
668 tags.</p></div>
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
686 this case.</p></div>
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&#8217;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>
706 </div></div>
707 </div>
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>
711 </div>
712 <h2 id="_author">Author</h2>
713 <div class="sectionbody">
714 <div class="paragraph"><p>Written by Linus Torvalds &lt;<a href="mailto:torvalds@osdl.org">torvalds@osdl.org</a>&gt;,
715 Junio C Hamano &lt;<a href="mailto:gitster@pobox.com">gitster@pobox.com</a>&gt; and Chris Wright &lt;<a href="mailto:chrisw@osdl.org">chrisw@osdl.org</a>&gt;.</p></div>
716 </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 &lt;<a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a>&gt;.</p></div>
720 </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>
724 </div>
725 <div id="footer">
726 <div id="footer-text">
727 Last updated 2010-11-25 03:13:43 UTC
728 </div>
729 </div>
730 </body>
731 </html>