Autogenerated HTML docs for v1.6.3.2-214-gf4f78
[git/jnareb-git.git] / git-tag.html
blob6d64d00d76fa4c200fca6abcb80b19367509e0f1
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.2.5" />
7 <style type="text/css">
8 /* Debug borders */
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11 border: 1px solid red;
15 body {
16 margin: 1em 5% 1em 5%;
19 a {
20 color: blue;
21 text-decoration: underline;
23 a:visited {
24 color: fuchsia;
27 em {
28 font-style: italic;
31 strong {
32 font-weight: bold;
35 tt {
36 color: navy;
39 h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
47 h1, h2, h3 {
48 border-bottom: 2px solid silver;
50 h2 {
51 padding-top: 0.5em;
53 h3 {
54 float: left;
56 h3 + * {
57 clear: left;
60 div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
65 hr {
66 border: 1px solid silver;
69 p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
74 pre {
75 padding: 0;
76 margin: 0;
79 span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
83 font-size: 1.1em;
85 span#email {
87 span#revision {
88 font-family: sans-serif;
91 div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
98 div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
102 div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
107 div#preamble,
108 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110 div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
115 div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
120 div.content { /* Block element content. */
121 padding: 0;
124 /* Block element titles. */
125 div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
132 div.title + * {
133 margin-top: 0;
136 td div.title:first-child {
137 margin-top: 0.0em;
139 div.content div.title:first-child {
140 margin-top: 0.0em;
142 div.content + div.title {
143 margin-top: 0.0em;
146 div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
152 div.listingblock {
153 margin-right: 0%;
155 div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
161 div.quoteblock > div.content {
162 padding-left: 2.0em;
165 div.attribution {
166 text-align: right;
168 div.verseblock + div.attribution {
169 text-align: left;
172 div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
180 div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
185 div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
190 div.verseblock div.content {
191 white-space: pre;
194 div.imageblock div.content { padding-left: 0; }
195 div.imageblock img { border: 1px solid silver; }
196 span.image img { border-style: none; }
198 dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
202 dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
207 dd > *:first-child {
208 margin-top: 0;
211 ul, ol {
212 list-style-position: outside;
214 div.olist2 ol {
215 list-style-type: lower-alpha;
218 div.tableblock > table {
219 border: 3px solid #527bbd;
221 thead {
222 font-family: sans-serif;
223 font-weight: bold;
225 tfoot {
226 font-weight: bold;
229 div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
233 div.hlist td {
234 padding-bottom: 5px;
236 td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
241 td.hlist2 {
242 vertical-align: top;
245 @media print {
246 div#footer-badges { display: none; }
249 div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
258 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
262 div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
266 div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
270 div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
274 include1::./stylesheets/xhtml11-manpage.css[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
282 div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
289 div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
295 div.quoteblock-content {
296 padding-left: 2.0em;
299 div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc a:visited { color: blue; }
306 </style>
307 <title>git-tag(1)</title>
308 </head>
309 <body>
310 <div id="header">
311 <h1>
312 git-tag(1) Manual Page
313 </h1>
314 <h2>NAME</h2>
315 <div class="sectionbody">
316 <p>git-tag -
317 Create, list, delete or verify a tag object signed with GPG
318 </p>
319 </div>
320 </div>
321 <h2>SYNOPSIS</h2>
322 <div class="sectionbody">
323 <div class="verseblock">
324 <div class="content"><em>git tag</em> [-a | -s | -u &lt;key-id&gt;] [-f] [-m &lt;msg&gt; | -F &lt;file&gt;]
325 &lt;name&gt; [&lt;commit&gt; | &lt;object&gt;]
326 <em>git tag</em> -d &lt;name&gt;&#8230;
327 <em>git tag</em> [-n[&lt;num&gt;]] -l [--contains &lt;commit&gt;] [&lt;pattern&gt;]
328 <em>git tag</em> -v &lt;name&gt;&#8230;</div></div>
329 </div>
330 <h2 id="_description">DESCRIPTION</h2>
331 <div class="sectionbody">
332 <div class="para"><p>Adds a <em>tag</em> reference in <tt>.git/refs/tags/</tt></p></div>
333 <div class="para"><p>Unless <tt>-f</tt> is given, the tag must not yet exist in
334 <tt>.git/refs/tags/</tt> directory.</p></div>
335 <div class="para"><p>If one of <tt>-a</tt>, <tt>-s</tt>, or <tt>-u &lt;key-id&gt;</tt> is passed, the command
336 creates a <em>tag</em> object, and requires the tag message. Unless
337 <tt>-m &lt;msg&gt;</tt> or <tt>-F &lt;file&gt;</tt> is given, an editor is started for the user to type
338 in the tag message.</p></div>
339 <div class="para"><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>
340 are absent, <tt>-a</tt> is implied.</p></div>
341 <div class="para"><p>Otherwise just the SHA1 object name of the commit object is
342 written (i.e. a lightweight tag).</p></div>
343 <div class="para"><p>A GnuPG signed tag object will be created when <tt>-s</tt> or <tt>-u
344 &lt;key-id&gt;</tt> is used. When <tt>-u &lt;key-id&gt;</tt> is not used, the
345 committer identity for the current user is used to find the
346 GnuPG key for signing.</p></div>
347 </div>
348 <h2 id="_options">OPTIONS</h2>
349 <div class="sectionbody">
350 <div class="vlist"><dl>
351 <dt>
353 </dt>
354 <dd>
356 Make an unsigned, annotated tag object
357 </p>
358 </dd>
359 <dt>
361 </dt>
362 <dd>
364 Make a GPG-signed tag, using the default e-mail address's key
365 </p>
366 </dd>
367 <dt>
368 -u &lt;key-id&gt;
369 </dt>
370 <dd>
372 Make a GPG-signed tag, using the given key
373 </p>
374 </dd>
375 <dt>
377 </dt>
378 <dd>
380 Replace an existing tag with the given name (instead of failing)
381 </p>
382 </dd>
383 <dt>
385 </dt>
386 <dd>
388 Delete existing tags with the given names.
389 </p>
390 </dd>
391 <dt>
393 </dt>
394 <dd>
396 Verify the gpg signature of the given tag names.
397 </p>
398 </dd>
399 <dt>
400 -n&lt;num&gt;
401 </dt>
402 <dd>
404 &lt;num&gt; specifies how many lines from the annotation, if any,
405 are printed when using -l.
406 The default is not to print any annotation lines.
407 If no number is given to <tt>-n</tt>, only the first line is printed.
408 If the tag is not annotated, the commit message is displayed instead.
409 </p>
410 </dd>
411 <dt>
412 -l &lt;pattern&gt;
413 </dt>
414 <dd>
416 List tags with names that match the given pattern (or all if no pattern is given).
417 Typing "git tag" without arguments, also lists all tags.
418 </p>
419 </dd>
420 <dt>
421 --contains &lt;commit&gt;
422 </dt>
423 <dd>
425 Only list tags which contain the specified commit.
426 </p>
427 </dd>
428 <dt>
429 -m &lt;msg&gt;
430 </dt>
431 <dd>
433 Use the given tag message (instead of prompting).
434 If multiple <tt>-m</tt> options are given, their values are
435 concatenated as separate paragraphs.
436 Implies <tt>-a</tt> if none of <tt>-a</tt>, <tt>-s</tt>, or <tt>-u &lt;key-id&gt;</tt>
437 is given.
438 </p>
439 </dd>
440 <dt>
441 -F &lt;file&gt;
442 </dt>
443 <dd>
445 Take the tag message from the given file. Use <em>-</em> to
446 read the message from the standard input.
447 Implies <tt>-a</tt> if none of <tt>-a</tt>, <tt>-s</tt>, or <tt>-u &lt;key-id&gt;</tt>
448 is given.
449 </p>
450 </dd>
451 </dl></div>
452 </div>
453 <h2 id="_configuration">CONFIGURATION</h2>
454 <div class="sectionbody">
455 <div class="para"><p>By default, <em>git-tag</em> in sign-with-default mode (-s) will use your
456 committer identity (of the form "Your Name &lt;your@email.address&gt;") to
457 find a key. If you want to use a different default key, you can specify
458 it in the repository configuration as follows:</p></div>
459 <div class="listingblock">
460 <div class="content">
461 <pre><tt>[user]
462 signingkey = &lt;gpg-key-id&gt;</tt></pre>
463 </div></div>
464 </div>
465 <h2 id="_discussion">DISCUSSION</h2>
466 <div class="sectionbody">
467 <h3 id="_on_re_tagging">On Re-tagging</h3><div style="clear:left"></div>
468 <div class="para"><p>What should you do when you tag a wrong commit and you would
469 want to re-tag?</p></div>
470 <div class="para"><p>If you never pushed anything out, just re-tag it. Use "-f" to
471 replace the old one. And you're done.</p></div>
472 <div class="para"><p>But if you have pushed things out (or others could just read
473 your repository directly), then others will have already seen
474 the old tag. In that case you can do one of two things:</p></div>
475 <div class="olist"><ol>
476 <li>
478 The sane thing.
479 Just admit you screwed up, and use a different name. Others have
480 already seen one tag-name, and if you keep the same name, you
481 may be in the situation that two people both have "version X",
482 but they actually have <em>different</em> "X"'s. So just call it "X.1"
483 and be done with it.
484 </p>
485 </li>
486 <li>
488 The insane thing.
489 You really want to call the new version "X" too, <em>even though</em>
490 others have already seen the old one. So just use <em>git-tag -f</em>
491 again, as if you hadn't already published the old one.
492 </p>
493 </li>
494 </ol></div>
495 <div class="para"><p>However, Git does <strong>not</strong> (and it should not) change tags behind
496 users back. So if somebody already got the old tag, doing a
497 <em>git-pull</em> on your tree shouldn't just make them overwrite the old
498 one.</p></div>
499 <div class="para"><p>If somebody got a release tag from you, you cannot just change
500 the tag for them by updating your own one. This is a big
501 security issue, in that people MUST be able to trust their
502 tag-names. If you really want to do the insane thing, you need
503 to just fess up to it, and tell people that you messed up. You
504 can do that by making a very public announcement saying:</p></div>
505 <div class="listingblock">
506 <div class="content">
507 <pre><tt>Ok, I messed up, and I pushed out an earlier version tagged as X. I
508 then fixed something, and retagged the *fixed* tree as X again.
510 If you got the wrong tag, and want the new one, please delete
511 the old one and fetch the new one by doing:
513 git tag -d X
514 git fetch origin tag X
516 to get my updated tag.
518 You can test which tag you have by doing
520 git rev-parse X
522 which should return 0123456789abcdef.. if you have the new version.
524 Sorry for inconvenience.</tt></pre>
525 </div></div>
526 <div class="para"><p>Does this seem a bit complicated? It <strong>should</strong> be. There is no
527 way that it would be correct to just "fix" it behind peoples
528 backs. People need to know that their tags might have been
529 changed.</p></div>
530 <h3 id="_on_automatic_following">On Automatic following</h3><div style="clear:left"></div>
531 <div class="para"><p>If you are following somebody else's tree, you are most likely
532 using tracking branches (<tt>refs/heads/origin</tt> in traditional
533 layout, or <tt>refs/remotes/origin/master</tt> in the separate-remote
534 layout). You usually want the tags from the other end.</p></div>
535 <div class="para"><p>On the other hand, if you are fetching because you would want a
536 one-shot merge from somebody else, you typically do not want to
537 get tags from there. This happens more often for people near
538 the toplevel but not limited to them. Mere mortals when pulling
539 from each other do not necessarily want to automatically get
540 private anchor point tags from the other person.</p></div>
541 <div class="para"><p>You would notice "please pull" messages on the mailing list says
542 repo URL and branch name alone. This is designed to be easily
543 cut&amp;pasted to a <em>git-fetch</em> command line:</p></div>
544 <div class="listingblock">
545 <div class="content">
546 <pre><tt>Linus, please pull from
548 git://git..../proj.git master
550 to get the following updates...</tt></pre>
551 </div></div>
552 <div class="para"><p>becomes:</p></div>
553 <div class="listingblock">
554 <div class="content">
555 <pre><tt>$ git pull git://git..../proj.git master</tt></pre>
556 </div></div>
557 <div class="para"><p>In such a case, you do not want to automatically follow other's
558 tags.</p></div>
559 <div class="para"><p>One important aspect of git is it is distributed, and being
560 distributed largely means there is no inherent "upstream" or
561 "downstream" in the system. On the face of it, the above
562 example might seem to indicate that the tag namespace is owned
563 by upper echelon of people and tags only flow downwards, but
564 that is not the case. It only shows that the usage pattern
565 determines who are interested in whose tags.</p></div>
566 <div class="para"><p>A one-shot pull is a sign that a commit history is now crossing
567 the boundary between one circle of people (e.g. "people who are
568 primarily interested in the networking part of the kernel") who may
569 have their own set of tags (e.g. "this is the third release
570 candidate from the networking group to be proposed for general
571 consumption with 2.6.21 release") to another circle of people
572 (e.g. "people who integrate various subsystem improvements").
573 The latter are usually not interested in the detailed tags used
574 internally in the former group (that is what "internal" means).
575 That is why it is desirable not to follow tags automatically in
576 this case.</p></div>
577 <div class="para"><p>It may well be that among networking people, they may want to
578 exchange the tags internal to their group, but in that workflow
579 they are most likely tracking with each other's progress by
580 having tracking branches. Again, the heuristic to automatically
581 follow such tags is a good thing.</p></div>
582 <h3 id="_on_backdating_tags">On Backdating Tags</h3><div style="clear:left"></div>
583 <div class="para"><p>If you have imported some changes from another VCS and would like
584 to add tags for major releases of your work, it is useful to be able
585 to specify the date to embed inside of the tag object. The data in
586 the tag object affects, for example, the ordering of tags in the
587 gitweb interface.</p></div>
588 <div class="para"><p>To set the date used in future tag objects, set the environment
589 variable GIT_COMMITTER_DATE to one or more of the date and time. The
590 date and time can be specified in a number of ways; the most common
591 is "YYYY-MM-DD HH:MM".</p></div>
592 <div class="para"><p>An example follows.</p></div>
593 <div class="listingblock">
594 <div class="content">
595 <pre><tt>$ GIT_COMMITTER_DATE="2006-10-02 10:31" git tag -s v1.0.1</tt></pre>
596 </div></div>
597 </div>
598 <h2 id="_author">Author</h2>
599 <div class="sectionbody">
600 <div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;,
601 Junio C Hamano &lt;gitster@pobox.com&gt; and Chris Wright &lt;chrisw@osdl.org&gt;.</p></div>
602 </div>
603 <h2 id="_documentation">Documentation</h2>
604 <div class="sectionbody">
605 <div class="para"><p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
606 </div>
607 <h2 id="_git">GIT</h2>
608 <div class="sectionbody">
609 <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
610 </div>
611 <div id="footer">
612 <div id="footer-text">
613 Last updated 2009-04-02 06:50:06 UTC
614 </div>
615 </div>
616 </body>
617 </html>