1git-name-rev(1)
2===============
34
NAME
5----
6git-name-rev - Find symbolic names for given revs
78
9
SYNOPSIS
10--------
11[verse]
12'git name-rev' [--tags] [--refs=<pattern>]
13( --all | --stdin | <committish>... )
1415
DESCRIPTION
16-----------
17Finds symbolic names suitable for human digestion for revisions given in any
18format parsable by 'git rev-parse'.
1920
21
OPTIONS
22-------
2324
--tags::
25Do not use branch names, but only tags to name the commits
2627
--refs=<pattern>::
28Only use refs whose names match a given shell pattern.
2930
--all::
31List all commits reachable from all refs
3233
--stdin::
34Read from stdin, append "(<rev_name>)" to all sha1's of nameable
35commits, and pass to stdout
3637
--name-only::
38Instead of printing both the SHA-1 and the name, print only
39the name. If given with --tags the usual tag prefix of
40"tags/" is also omitted from the name, matching the output
41of `git-describe` more closely.
4243
--no-undefined::
44Die with error code != 0 when a reference is undefined,
45instead of printing `undefined`.
4647
--always::
48Show uniquely abbreviated commit object as fallback.
4950
EXAMPLE
51-------
5253
Given a commit, find out where it is relative to the local refs. Say somebody
54wrote you about that fantastic commit 33db5f4d9027a10e477ccf054b2c1ab94f74c85a.
55Of course, you look into the commit, but that only tells you what happened, but
56not the context.
5758
Enter 'git name-rev':
5960
------------
61% git name-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a
6233db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99~940
63------------
6465
Now you are wiser, because you know that it happened 940 revisions before v0.99.
6667
Another nice thing you can do is:
6869
------------
70% git log | git name-rev --stdin
71------------
7273
GIT
74---
75Part of the linkgit:git[1] suite