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.4.5" />
7 <title>git-tag(
1)
</title>
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.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
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
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
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
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
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-tag(
1) Manual Page
409 <div class=
"sectionbody">
411 Create, list, delete or verify a tag object signed with GPG
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
<key-id
>] [-f] [-m
<msg
> | -F
<file
>]
419 <tagname
> [
<commit
> |
<object
>]
420 <em>git tag
</em> -d
<tagname
>…
421 <em>git tag
</em> [-n[
<num
>]] -l [--contains
<commit
>] [
<pattern
>…]
422 <em>git tag
</em> -v
<tagname
>…</div>
423 <div class=
"verseblock-attribution">
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
<key-id
></tt> is passed, the command
433 creates a
<em>tag
</em> object, and requires a tag message. Unless
434 <tt>-m
<msg
></tt> or
<tt>-F
<file
></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
<msg
></tt> or
<tt>-F
<file
></tt> is given and
<tt>-a
</tt>,
<tt>-s
</tt>, and
<tt>-u
<key-id
></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 <key-id
></tt> is used. When
<tt>-u
<key-id
></tt> is not used, the
442 committer identity for the current user is used to find the
443 GnuPG key for signing.
</p></div>
445 <h2 id=
"_options">OPTIONS
</h2>
446 <div class=
"sectionbody">
447 <div class=
"dlist"><dl>
453 Make an unsigned, annotated tag object
461 Make a GPG-signed tag, using the default e-mail address
’s key
469 Make a GPG-signed tag, using the given key
480 Replace an existing tag with the given name (instead of failing)
488 Delete existing tags with the given names.
496 Verify the gpg signature of the given tag names.
504 <num
> 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.
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.
524 --contains
<commit
>
528 Only list tags which contain the specified commit.
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
<key-id
></tt>
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
<key-id
></tt>
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.
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 <<a href="mailto:your@email.address
">your@email.address</a>>") 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">
576 signingkey =
<gpg-key-id
></tt></pre>
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
’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">
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"
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
’t already published the old one.
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
’t just make them overwrite the old
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:
628 git fetch origin tag X
630 to get my updated tag.
632 You can test which tag you have by doing
636 which should return
0123456789abcdef.. if you have the new version.
638 Sorry for the inconvenience.
</tt></pre>
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
’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
&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>
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>
671 <div class=
"paragraph"><p>In such a case, you do not want to automatically follow the other
672 person
’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
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
’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>
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>
721 It is
<tt><unix timestamp
> <timezone offset
></tt>, where
<tt><unix
722 timestamp
></tt> is the number of seconds since the UNIX epoch.
723 <tt><timezone offset
></tt> is a positive or negative offset from UTC.
724 For example CET (which is
2 hours ahead UTC) is
<tt>+
0200</tt>.
732 The standard email format as described by RFC
2822, for example
733 <tt>Thu,
07 Apr
2005 22:
13:
13 +
0200</tt>.
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.
745 <div class=
"admonitionblock">
748 <div class=
"title">Note
</div>
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>
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>
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>
766 <div id=
"footer-text">
767 Last updated
2011-
07-
19 20:
01:
51 UTC