blob: 976dc1493799c46bc2a390fde36063ae4e7a0e11 [file] [log] [blame]
Junio C Hamano74640642006-12-27 10:59:551git-reflog(1)
2=============
3
4NAME
5----
6git-reflog - Manage reflog information
7
8
9SYNOPSIS
10--------
Junio C Hamano15567bc2011-07-23 00:51:5911[verse]
Junio C Hamanod3339982007-02-09 08:38:4812'git reflog' <subcommand> <options>
Junio C Hamano74640642006-12-27 10:59:5513
14DESCRIPTION
15-----------
Junio C Hamanod3339982007-02-09 08:38:4816The command takes various subcommands, and different options
17depending on the subcommand:
18
19[verse]
Junio C Hamanoba4b9282008-07-06 05:20:3120'git reflog expire' [--dry-run] [--stale-fix] [--verbose]
Junio C Hamanod3339982007-02-09 08:38:4821[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...
Junio C Hamanoba4b9282008-07-06 05:20:3122'git reflog delete' ref@\{specifier\}...
Junio C Hamanoba4b9282008-07-06 05:20:3123'git reflog' ['show'] [log-options] [<ref>]
Junio C Hamano74640642006-12-27 10:59:5524
25Reflog is a mechanism to record when the tip of branches are
26updated. This command is to manage the information recorded in it.
27
28The subcommand "expire" is used to prune older reflog entries.
29Entries older than `expire` time, or entries older than
Junio C Hamano54bf1e22008-12-20 06:30:1130`expire-unreachable` time and not reachable from the current
Junio C Hamano74640642006-12-27 10:59:5531tip, are removed from the reflog. This is typically not used
Junio C Hamano35738e82008-01-07 07:55:4632directly by the end users -- instead, see linkgit:git-gc[1].
Junio C Hamano74640642006-12-27 10:59:5533
Junio C Hamanoa6387422007-08-25 03:54:2734The subcommand "show" (which is also the default, in the absence of any
Junio C Hamanod3339982007-02-09 08:38:4835subcommands) will take all the normal log options, and show the log of
Junio C Hamano2e72a942007-11-21 08:54:4236the reference provided in the command-line (or `HEAD`, by default).
37The reflog will cover all recent actions (HEAD reflog records branch switching
Junio C Hamanoba4b9282008-07-06 05:20:3138as well). It is an alias for `git log -g --abbrev-commit --pretty=oneline`;
Junio C Hamano35738e82008-01-07 07:55:4639see linkgit:git-log[1].
Junio C Hamano2e72a942007-11-21 08:54:4240
41The reflog is useful in various git commands, to specify the old value
42of a reference. For example, `HEAD@\{2\}` means "where HEAD used to be
43two moves ago", `master@\{one.week.ago\}` means "where master used to
Junio C Hamanoc27b7332010-10-14 04:37:2844point to one week ago", and so on. See linkgit:gitrevisions[7] for
Junio C Hamano2e72a942007-11-21 08:54:4245more details.
Junio C Hamano74640642006-12-27 10:59:5546
Junio C Hamano86bcccc2008-03-08 09:33:5547To delete single entries from the reflog, use the subcommand "delete"
Junio C Hamanoba4b9282008-07-06 05:20:3148and specify the _exact_ entry (e.g. "`git reflog delete master@\{2\}`").
Junio C Hamano86bcccc2008-03-08 09:33:5549
Junio C Hamano74640642006-12-27 10:59:5550
51OPTIONS
52-------
53
Junio C Hamanoee695f22007-06-21 00:35:3654--stale-fix::
55This revamps the logic -- the definition of "broken commit"
56becomes: a commit that is not reachable from any of the refs and
57there is a missing object among the commit, tree, or blob
58objects reachable from it that is not reachable from any of the
59refs.
60+
61This computation involves traversing all the reachable objects, i.e. it
Junio C Hamano1aa40d22010-01-21 17:46:4362has the same cost as 'git prune'. Fortunately, once this is run, we
Junio C Hamanoee695f22007-06-21 00:35:3663should not have to ever worry about missing objects, because the current
64prune and pack-objects know about reflogs and protect objects referred by
65them.
66
Junio C Hamano74640642006-12-27 10:59:5567--expire=<time>::
68Entries older than this time are pruned. Without the
69option it is taken from configuration `gc.reflogExpire`,
70which in turn defaults to 90 days.
71
72--expire-unreachable=<time>::
Junio C Hamano54bf1e22008-12-20 06:30:1173Entries older than this time and not reachable from
Junio C Hamano74640642006-12-27 10:59:5574the current tip of the branch are pruned. Without the
75option it is taken from configuration
76`gc.reflogExpireUnreachable`, which in turn defaults to
7730 days.
78
79--all::
80Instead of listing <refs> explicitly, prune all refs.
81
Junio C Hamano86bcccc2008-03-08 09:33:5582--updateref::
83Update the ref with the sha1 of the top reflog entry (i.e.
84<ref>@\{0\}) after expiring or deleting.
85
86--rewrite::
87While expiring or deleting, adjust each reflog entry to ensure
88that the `old` sha1 field points to the `new` sha1 field of the
89previous entry.
90
Junio C Hamano764a6672007-10-23 01:23:3191--verbose::
92Print extra information on screen.
93
Junio C Hamano74640642006-12-27 10:59:5594GIT
95---
Junio C Hamanof7c042d2008-06-06 22:50:5396Part of the linkgit:git[1] suite