1GIT-NAME-REV(1) Git Manual GIT-NAME-REV(1)
2
3
4
6 git-name-rev - Find symbolic names for given revs
7
9 git name-rev [--tags] [--refs=<pattern>]
10 ( --all | --stdin | <committish>... )
11
12
14 Finds symbolic names suitable for human digestion for revisions given
15 in any format parsable by git rev-parse.
16
18 --tags
19 Do not use branch names, but only tags to name the commits
20
21 --refs=<pattern>
22 Only use refs whose names match a given shell pattern.
23
24 --all
25 List all commits reachable from all refs
26
27 --stdin
28 Read from stdin, append "(<rev_name>)" to all sha1’s of nameable
29 commits, and pass to stdout
30
31 --name-only
32 Instead of printing both the SHA-1 and the name, print only the
33 name. If given with --tags the usual tag prefix of "tags/" is also
34 omitted from the name, matching the output of git-describe more
35 closely.
36
37 --no-undefined
38 Die with error code != 0 when a reference is undefined, instead of
39 printing undefined.
40
41 --always
42 Show uniquely abbreviated commit object as fallback.
43
45 Given a commit, find out where it is relative to the local refs. Say
46 somebody wrote you about that fantastic commit
47 33db5f4d9027a10e477ccf054b2c1ab94f74c85a. Of course, you look into the
48 commit, but that only tells you what happened, but not the context.
49
50 Enter git name-rev:
51
52 % git name-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a
53 33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99~940
54
55
56 Now you are wiser, because you know that it happened 940 revisions
57 before v0.99.
58
59 Another nice thing you can do is:
60
61 % git log | git name-rev --stdin
62
63
65 Written by Johannes Schindelin <Johannes.Schindelin@gmx.de[1]>
66
68 Documentation by Johannes Schindelin.
69
71 Part of the git(1) suite
72
74 1. Johannes.Schindelin@gmx.de
75 mailto:Johannes.Schindelin@gmx.de
76
77
78
79Git 1.7.1 08/16/2017 GIT-NAME-REV(1)