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.5.2" />
7 <title>git-describe(
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.0em;
131 div
.content
{ /* Block element content. */
135 /* Block element titles. */
136 div
.title
, caption
.title
{
138 font-family: sans-serif
;
142 margin-bottom: 0.5em;
148 td div
.title:first-child
{
151 div
.content div
.title:first-child
{
154 div
.content
+ div
.title
{
158 div
.sidebarblock
> div
.content
{
160 border: 1px solid silver
;
164 div
.listingblock
> div
.content
{
165 border: 1px solid silver
;
170 div
.quoteblock
, div
.verseblock
{
174 border-left: 5px solid
#dddddd;
178 div
.quoteblock
> div
.attribution
{
183 div
.verseblock
> div
.content
{
186 div
.verseblock
> div
.attribution
{
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div
.verseblock
+ div
.attribution
{
195 div
.admonitionblock
.icon
{
199 text-decoration: underline
;
201 padding-right: 0.5em;
203 div
.admonitionblock td
.content
{
205 border-left: 3px solid
#dddddd;
208 div
.exampleblock
> div
.content
{
209 border-left: 3px solid
#dddddd;
213 div
.imageblock div
.content
{ padding-left: 0; }
214 span
.image img
{ border-style: none
; }
215 a
.image:visited
{ color: white
; }
219 margin-bottom: 0.8em;
232 list-style-position: outside
;
235 list-style-type: decimal
;
238 list-style-type: lower-alpha
;
241 list-style-type: upper-alpha
;
244 list-style-type: lower-roman
;
247 list-style-type: upper-roman
;
250 div
.compact ul
, div
.compact ol
,
251 div
.compact p
, div
.compact p
,
252 div
.compact div
, div
.compact div
{
254 margin-bottom: 0.1em;
257 div
.tableblock
> table
{
258 border: 3px solid
#527bbd;
260 thead
, p
.table
.header
{
261 font-family: sans-serif
;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div
.tableblock
> table
[frame
="void"] {
277 div
.tableblock
> table
[frame
="hsides"] {
278 border-left-style: none
;
279 border-right-style: none
;
281 div
.tableblock
> table
[frame
="vsides"] {
282 border-top-style: none
;
283 border-bottom-style: none
;
289 margin-bottom: 0.8em;
292 padding-bottom: 15px;
294 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
300 padding-right: 0.8em;
306 div
.hdlist
.compact tr
{
315 .footnote, .footnoteref {
319 span
.footnote
, span
.footnoteref
{
320 vertical-align: super
;
324 margin: 20px 0 20px 0;
328 #footnotes div
.footnote
{
334 border-top: 1px solid silver
;
344 div#footer-badges
{ display: none
; }
348 margin-bottom: 2.5em;
353 font-family: sans-serif
;
357 margin-bottom: 0.1em;
360 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
376 /* Overrides for manpage documents */
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver
;
381 border-bottom: 2px solid silver
;
391 div#toc
{ display: none
; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div
.sidebar-content
{
398 border: 1px solid silver
;
401 div
.sidebar-title
, div
.image-title
{
403 font-family: sans-serif
;
406 margin-bottom: 0.5em;
409 div
.listingblock div
.content
{
410 border: 1px solid silver
;
415 div
.quoteblock-attribution
{
420 div
.verseblock-content
{
423 div
.verseblock-attribution
{
428 div
.exampleblock-content
{
429 border-left: 3px solid
#dddddd;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc
a:visited
{ color: blue
; }
436 <script type=
"text/javascript">
438 window
.onload = function(){asciidoc
.footnotes();}
439 var asciidoc
= { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
459 toc: function (toclevels
) {
461 function getText(el
) {
463 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
464 if (i
.nodeType
== 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
466 else if (i
.firstChild
!= null)
472 function TocEntry(el
, text
, toclevel
) {
475 this.toclevel
= toclevel
;
478 function tocEntries(el
, toclevels
) {
479 var result
= new Array
;
480 var re
= new RegExp('[hH]([2-'+(toclevels
+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
484 var iterate = function (el
) {
485 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
486 if (i
.nodeType
== 1 /* Node.ELEMENT_NODE */) {
487 var mo
= re
.exec(i
.tagName
);
488 if (mo
&& (i
.getAttribute("class") || i
.getAttribute("className")) != "float") {
489 result
[result
.length
] = new TocEntry(i
, getText(i
), mo
[1]-1);
499 var toc
= document
.getElementById("toc");
500 var entries
= tocEntries(document
.getElementById("content"), toclevels
);
501 for (var i
= 0; i
< entries
.length
; ++i
) {
502 var entry
= entries
[i
];
503 if (entry
.element
.id
== "")
504 entry
.element
.id
= "_toc_" + i
;
505 var a
= document
.createElement("a");
506 a
.href
= "#" + entry
.element
.id
;
507 a
.appendChild(document
.createTextNode(entry
.text
));
508 var div
= document
.createElement("div");
510 div
.className
= "toclevel" + entry
.toclevel
;
511 toc
.appendChild(div
);
513 if (entries
.length
== 0)
514 toc
.parentNode
.removeChild(toc
);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont
= document
.getElementById("content");
528 var noteholder
= document
.getElementById("footnotes");
529 var spans
= cont
.getElementsByTagName("span");
532 for (i
=0; i
<spans
.length
; i
++) {
533 if (spans
[i
].className
== "footnote") {
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note
= spans
[i
].innerHTML
.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder
.innerHTML
+=
539 "<div class='footnote' id='_footnote_" + n
+ "'>" +
540 "<a href='#_footnoteref_" + n
+ "' title='Return to text'>" +
541 n
+ "</a>. " + note
+ "</div>";
543 "[<a id='_footnoteref_" + n
+ "' href='#_footnote_" + n
+
544 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
545 var id
=spans
[i
].getAttribute("id");
546 if (id
!= null) refs
["#"+id
] = n
;
550 noteholder
.parentNode
.removeChild(noteholder
);
552 // Process footnoterefs.
553 for (i
=0; i
<spans
.length
; i
++) {
554 if (spans
[i
].className
== "footnoteref") {
555 var href
= spans
[i
].getElementsByTagName("a")[0].getAttribute("href");
556 href
= href
.match(/#.*/)[0]; // Because IE return full URL.
559 "[<a href='#_footnote_" + n
+
560 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
573 git-describe(
1) Manual Page
576 <div class=
"sectionbody">
578 Show the most recent tag that is reachable from a commit
583 <h2 id=
"_synopsis">SYNOPSIS
</h2>
584 <div class=
"sectionbody">
585 <div class=
"verseblock">
586 <div class=
"verseblock-content"><em>git describe
</em> [--all] [--tags] [--contains] [--abbrev=
<n
>]
<committish
>…
587 <em>git describe
</em> [--all] [--tags] [--contains] [--abbrev=
<n
>] --dirty[=
<mark
>]
</div>
588 <div class=
"verseblock-attribution">
591 <h2 id=
"_description">DESCRIPTION
</h2>
592 <div class=
"sectionbody">
593 <div class=
"paragraph"><p>The command finds the most recent tag that is reachable from a
594 commit. If the tag points to the commit, then only the tag is
595 shown. Otherwise, it suffixes the tag name with the number of
596 additional commits on top of the tagged object and the
597 abbreviated object name of the most recent commit.
</p></div>
598 <div class=
"paragraph"><p>By default (without --all or --tags)
<tt>git describe
</tt> only shows
599 annotated tags. For more information about creating annotated tags
600 see the -a and -s options to
<a href=
"git-tag.html">git-tag(
1)
</a>.
</p></div>
602 <h2 id=
"_options">OPTIONS
</h2>
603 <div class=
"sectionbody">
604 <div class=
"dlist"><dl>
606 <committish
>…
610 Committish object names to describe.
614 --dirty[=
<mark
>]
618 Describe the working tree.
619 It means describe HEAD and appends
<mark
> (
<tt>-dirty
</tt> by
620 default) if the working tree is dirty.
628 Instead of using only the annotated tags, use any ref
629 found in
<tt>.git/refs/
</tt>. This option enables matching
630 any known branch, remote-tracking branch, or lightweight tag.
638 Instead of using only the annotated tags, use any tag
639 found in
<tt>.git/refs/tags
</tt>. This option enables matching
640 a lightweight (non-annotated) tag.
648 Instead of finding the tag that predates the commit, find
649 the tag that comes after the commit, and thus contains it.
650 Automatically implies --tags.
658 Instead of using the default
7 hexadecimal digits as the
659 abbreviated object name, use
<n
> digits, or as many digits
660 as needed to form a unique object name. An
<n
> of
0
661 will suppress long format, only showing the closest tag.
665 --candidates=
<n
>
669 Instead of considering only the
10 most recent tags as
670 candidates to describe the input committish consider
671 up to
<n
> candidates. Increasing
<n
> above
10 will take
672 slightly longer but may produce a more accurate result.
673 An
<n
> of
0 will cause only exact matches to be output.
681 Only output exact matches (a tag directly references the
682 supplied commit). This is a synonym for --candidates=
0.
690 Verbosely display information about the searching strategy
691 being employed to standard error. The tag name will still
692 be printed to standard out.
700 Always output the long format (the tag, the number of commits
701 and the abbreviated commit name) even when it matches a tag.
702 This is useful when you want to see parts of the commit object name
703 in
"describe" output, even when the commit in question happens to be
704 a tagged version. Instead of just emitting the tag name, it will
705 describe such a commit as v1.2-
0-gdeadbee (
0th commit since tag v1.2
706 that points at object deadbee
….).
710 --match
<pattern
>
714 Only consider tags matching the given pattern (can be used to avoid
715 leaking private tags made from the repository).
723 Show uniquely abbreviated commit object as fallback.
728 <h2 id=
"_examples">EXAMPLES
</h2>
729 <div class=
"sectionbody">
730 <div class=
"paragraph"><p>With something like git.git current tree, I get:
</p></div>
731 <div class=
"literalblock">
732 <div class=
"content">
733 <pre><tt>[torvalds@g5 git]$ git describe parent
734 v1.0
.4-
14-g2414721
</tt></pre>
736 <div class=
"paragraph"><p>i.e. the current head of my
"parent" branch is based on v1.0
.4,
737 but since it has a few commits on top of that,
738 describe has added the number of additional commits (
"14") and
739 an abbreviated object name for the commit itself (
"2414721")
740 at the end.
</p></div>
741 <div class=
"paragraph"><p>The number of additional commits is the number
742 of commits which would be displayed by
"git log v1.0.4..parent".
743 The hash suffix is
"-g" +
7-char abbreviation for the tip commit
744 of parent (which was
<tt>2414721b194453f058079d897d13c4e377f92dc6
</tt>).
745 The
"g" prefix stands for
"git" and is used to allow describing the version of
746 a software depending on the SCM the software is managed with. This is useful
747 in an environment where people may use different SCMs.
</p></div>
748 <div class=
"paragraph"><p>Doing a
<em>git describe
</em> on a tag-name will just show the tag name:
</p></div>
749 <div class=
"literalblock">
750 <div class=
"content">
751 <pre><tt>[torvalds@g5 git]$ git describe v1.0
.4
754 <div class=
"paragraph"><p>With --all, the command can use branch heads as references, so
755 the output shows the reference path as well:
</p></div>
756 <div class=
"literalblock">
757 <div class=
"content">
758 <pre><tt>[torvalds@g5 git]$ git describe --all --abbrev=
4 v1.0
.5^
2
759 tags/v1.0
.0-
21-g975b
</tt></pre>
761 <div class=
"literalblock">
762 <div class=
"content">
763 <pre><tt>[torvalds@g5 git]$ git describe --all --abbrev=
4 HEAD^
764 heads/lt/describe-
7-g975b
</tt></pre>
766 <div class=
"paragraph"><p>With --abbrev set to
0, the command can be used to find the
767 closest tagname without any suffix:
</p></div>
768 <div class=
"literalblock">
769 <div class=
"content">
770 <pre><tt>[torvalds@g5 git]$ git describe --abbrev=
0 v1.0
.5^
2
771 tags/v1.0
.0</tt></pre>
773 <div class=
"paragraph"><p>Note that the suffix you get if you type these commands today may be
774 longer than what Linus saw above when he ran these commands, as your
775 git repository may have new commits whose object names begin with
776 975b that did not exist back then, and
"-g975b" suffix alone may not
777 be sufficient to disambiguate these commits.
</p></div>
779 <h2 id=
"_search_strategy">SEARCH STRATEGY
</h2>
780 <div class=
"sectionbody">
781 <div class=
"paragraph"><p>For each committish supplied,
<em>git describe
</em> will first look for
782 a tag which tags exactly that commit. Annotated tags will always
783 be preferred over lightweight tags, and tags with newer dates will
784 always be preferred over tags with older dates. If an exact match
785 is found, its name will be output and searching will stop.
</p></div>
786 <div class=
"paragraph"><p>If an exact match was not found,
<em>git describe
</em> will walk back
787 through the commit history to locate an ancestor commit which
788 has been tagged. The ancestor
’s tag will be output along with an
789 abbreviation of the input committish
’s SHA1.
</p></div>
790 <div class=
"paragraph"><p>If multiple tags were found during the walk then the tag which
791 has the fewest commits different from the input committish will be
792 selected and output. Here fewest commits different is defined as
793 the number of commits which would be shown by
<tt>git log tag..input
</tt>
794 will be the smallest number of commits possible.
</p></div>
796 <h2 id=
"_git">GIT
</h2>
797 <div class=
"sectionbody">
798 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
801 <div id=
"footnotes"><hr /></div>
803 <div id=
"footer-text">
804 Last updated
2011-
09-
21 23:
01:
14 PDT