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.2.5" />
7 <style type=
"text/css">
9 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
11 border: 1px solid red;
16 margin: 1em 5% 1em 5%;
21 text-decoration: underline
;
39 h1
, h2
, h3
, h4
, h5
, h6
{
41 font-family: sans-serif
;
48 border-bottom: 2px solid silver
;
66 border: 1px solid silver
;
81 font-family: sans-serif
;
88 font-family: sans-serif
;
92 font-family: sans-serif
;
94 border-top: 2px solid silver
;
100 padding-bottom: 0.5em;
104 padding-bottom: 0.5em;
108 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
109 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
110 div
.admonitionblock
{
113 margin-bottom: 1.5em;
115 div
.admonitionblock
{
117 margin-bottom: 2.5em;
120 div
.content
{ /* Block element content. */
124 /* Block element titles. */
125 div
.title
, caption
.title
{
126 font-family: sans-serif
;
130 margin-bottom: 0.5em;
136 td div
.title:first-child
{
139 div
.content div
.title:first-child
{
142 div
.content
+ div
.title
{
146 div
.sidebarblock
> div
.content
{
148 border: 1px solid silver
;
155 div
.listingblock
> div
.content
{
156 border: 1px solid silver
;
161 div
.quoteblock
> div
.content
{
168 div
.verseblock
+ div
.attribution
{
172 div
.admonitionblock
.icon
{
176 text-decoration: underline
;
178 padding-right: 0.5em;
180 div
.admonitionblock td
.content
{
182 border-left: 2px solid silver
;
185 div
.exampleblock
> div
.content
{
186 border-left: 2px solid silver
;
190 div
.verseblock div
.content
{
194 div
.imageblock div
.content
{ padding-left: 0; }
195 div
.imageblock img
{ border: 1px solid silver
; }
196 span
.image img
{ border-style: none
; }
200 margin-bottom: 0.8em;
212 list-style-position: outside
;
215 list-style-type: lower-alpha
;
218 div
.tableblock
> table
{
219 border: 3px solid
#527bbd;
222 font-family: sans-serif
;
231 margin-bottom: 0.8em;
239 padding-right: 0.8em;
246 div#footer-badges
{ display: none
; }
251 font-family: sans-serif
;
255 margin-bottom: 0.1em;
258 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
274 include1::./stylesheets
/xhtml11-manpage
.css
[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div
.sidebar-content
{
279 border: 1px solid silver
;
282 div
.sidebar-title
, div
.image-title
{
283 font-family: sans-serif
;
286 margin-bottom: 0.5em;
289 div
.listingblock div
.content
{
290 border: 1px solid silver
;
295 div
.quoteblock-content
{
299 div
.exampleblock-content
{
300 border-left: 2px solid silver
;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc
a:visited
{ color: blue
; }
307 <title>git-tag(
1)
</title>
312 git-tag(
1) Manual Page
315 <div class=
"sectionbody">
317 Create, list, delete or verify a tag object signed with GPG
322 <div class=
"sectionbody">
323 <div class=
"verseblock">
324 <div class=
"content"><em>git tag
</em> [-a | -s | -u
<key-id
>] [-f] [-m
<msg
> | -F
<file
>]
325 <name
> [
<commit
> |
<object
>]
326 <em>git tag
</em> -d
<name
>…
327 <em>git tag
</em> [-n[
<num
>]] -l [--contains
<commit
>] [
<pattern
>]
328 <em>git tag
</em> -v
<name
>…</div></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
<key-id
></tt> is passed, the command
336 creates a
<em>tag
</em> object, and requires the tag message. Unless
337 <tt>-m
<msg
></tt> or
<tt>-F
<file
></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
<msg
></tt> or
<tt>-F
<file
></tt> is given and
<tt>-a
</tt>,
<tt>-s
</tt>, and
<tt>-u
<key-id
></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 <key-id
></tt> is used. When
<tt>-u
<key-id
></tt> is not used, the
345 committer identity for the current user is used to find the
346 GnuPG key for signing.
</p></div>
348 <h2 id=
"_options">OPTIONS
</h2>
349 <div class=
"sectionbody">
350 <div class=
"vlist"><dl>
356 Make an unsigned, annotated tag object
364 Make a GPG-signed tag, using the default e-mail address's key
372 Make a GPG-signed tag, using the given key
380 Replace an existing tag with the given name (instead of failing)
388 Delete existing tags with the given names.
396 Verify the gpg signature of the given tag names.
404 <num
> 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.
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.
421 --contains
<commit
>
425 Only list tags which contain the specified commit.
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
<key-id
></tt>
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
<key-id
></tt>
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 <your@email.address>") 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">
462 signingkey =
<gpg-key-id
></tt></pre>
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>
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"
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.
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
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:
514 git fetch origin tag X
516 to get my updated tag.
518 You can test which tag you have by doing
522 which should return
0123456789abcdef.. if you have the new version.
524 Sorry for inconvenience.
</tt></pre>
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
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
&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>
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>
557 <div class=
"para"><p>In such a case, you do not want to automatically follow other's
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
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>
598 <h2 id=
"_author">Author
</h2>
599 <div class=
"sectionbody">
600 <div class=
"para"><p>Written by Linus Torvalds
<torvalds@osdl.org
>,
601 Junio C Hamano
<gitster@pobox.com
> and Chris Wright
<chrisw@osdl.org
>.
</p></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
<git@vger.kernel.org
>.
</p></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>
612 <div id=
"footer-text">
613 Last updated
2009-
07-
01 02:
31:
05 UTC