Allow default core.logallrefupdates to be overridden with template's config
[git/fastimport.git] / Documentation / git-describe.txt
blobb87783cf0956bba11ef0101a9ac80fe1f91e3f80
1 git-describe(1)
2 ===============
4 NAME
5 ----
6 git-describe - Show the most recent tag that is reachable from a commit
9 SYNOPSIS
10 --------
11 'git-describe' [--all] [--tags] [--abbrev=<n>] <committish>...
13 DESCRIPTION
14 -----------
15 The command finds the most recent tag that is reachable from a
16 commit, and if the commit itself is pointed at by the tag, shows
17 the tag.  Otherwise, it suffixes the tag name with abbreviated
18 object name of the commit.
21 OPTIONS
22 -------
23 <committish>::
24         The object name of the committish.
26 --all::
27         Instead of using only the annotated tags, use any ref
28         found in `.git/refs/`.
30 --tags::
31         Instead of using only the annotated tags, use any tag
32         found in `.git/refs/tags`.
34 --abbrev=<n>::
35         Instead of using the default 8 hexadecimal digits as the
36         abbreviated object name, use <n> digits.
38 --candidates=<n>::
39         Instead of considering only the 10 most recent tags as
40         candidates to describe the input committish consider
41         up to <n> candidates.  Increasing <n> above 10 will take
42         slightly longer but may produce a more accurate result.
44 --debug::
45         Verbosely display information about the searching strategy
46         being employed to standard error.  The tag name will still
47         be printed to standard out.
49 EXAMPLES
50 --------
52 With something like git.git current tree, I get:
54         [torvalds@g5 git]$ git-describe parent
55         v1.0.4-g2414721b
57 i.e. the current head of my "parent" branch is based on v1.0.4,
58 but since it has a few commits on top of that, it has added the
59 git hash of the thing to the end: "-g" + 8-char shorthand for
60 the commit `2414721b194453f058079d897d13c4e377f92dc6`.
62 Doing a "git-describe" on a tag-name will just show the tag name:
64         [torvalds@g5 git]$ git-describe v1.0.4
65         v1.0.4
67 With --all, the command can use branch heads as references, so
68 the output shows the reference path as well:
70         [torvalds@g5 git]$ git describe --all --abbrev=4 v1.0.5^2
71         tags/v1.0.0-g975b
73         [torvalds@g5 git]$ git describe --all HEAD^
74         heads/lt/describe-g975b
76 SEARCH STRATEGY
77 ---------------
79 For each committish supplied "git describe" will first look for
80 a tag which tags exactly that commit.  Annotated tags will always
81 be preferred over lightweight tags, and tags with newer dates will
82 always be preferred over tags with older dates.  If an exact match
83 is found, its name will be output and searching will stop.
85 If an exact match was not found "git describe" will walk back
86 through the commit history to locate an ancestor commit which
87 has been tagged.  The ancestor's tag will be output along with an
88 abbreviation of the input committish's SHA1.
90 If multiple tags were found during the walk then the tag which
91 has the fewest commits different from the input committish will be
92 selected and output.  Here fewest commits different is defined as
93 the number of commits which would be shown by "git log tag..input"
94 will be the smallest number of commits possible.
97 Author
98 ------
99 Written by Linus Torvalds <torvalds@osdl.org>, but somewhat
100 butchered by Junio C Hamano <junkio@cox.net>
102 Documentation
103 --------------
104 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
108 Part of the gitlink:git[7] suite