Skip to content

Commit 97e92e2

Browse files
moygitster
authored andcommitted
Doc fix for git-reflog: mention @{...} syntax, and <ref> in synopsys.
The HEAD@{...} syntax was documented in git-rev-parse manpage, which is hard to find by someone looking for the documentation of porcelain. git-reflog is probably the place where one expects to find this. While I'm there, "git revlog show whatever" was also undocumented. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent dec9230 commit 97e92e2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Documentation/git-reflog.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ depending on the subcommand:
1919
git reflog expire [--dry-run] [--stale-fix] [--verbose]
2020
[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...
2121

22-
git reflog [show] [log-options]
22+
git reflog [show] [log-options] [<ref>]
2323

2424
Reflog is a mechanism to record when the tip of branches are
2525
updated. This command is to manage the information recorded in it.
@@ -32,9 +32,16 @@ directly by the end users -- instead, see gitlink:git-gc[1].
3232

3333
The subcommand "show" (which is also the default, in the absence of any
3434
subcommands) will take all the normal log options, and show the log of
35-
`HEAD`, which will cover all recent actions, including branch switches.
36-
It is basically an alias for 'git log -g --abbrev-commit
37-
--pretty=oneline', see gitlink:git-log[1].
35+
the reference provided in the command-line (or `HEAD`, by default).
36+
The reflog will cover all recent actions (HEAD reflog records branch switching
37+
as well). It is an alias for 'git log -g --abbrev-commit --pretty=oneline';
38+
see gitlink:git-log[1].
39+
40+
The reflog is useful in various git commands, to specify the old value
41+
of a reference. For example, `HEAD@\{2\}` means "where HEAD used to be
42+
two moves ago", `master@\{one.week.ago\}` means "where master used to
43+
point to one week ago", and so on. See gitlink:git-rev-parse[1] for
44+
more details.
3845

3946

4047
OPTIONS

0 commit comments

Comments
 (0)