blob: 70791b9fd88b4c64260523a5fcadcb46ce504f8f [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
Junio C Hamano076ffcc2013-02-06 05:13:2141The reflog is useful in various Git commands, to specify the old value
Junio C Hamanob76a6862012-05-02 22:02:4642of 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 Hamanob76a6862012-05-02 22:02:4648and 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`,
Junio C Hamanoc7102962013-05-29 23:57:1770which in turn defaults to 90 days. --expire=all prunes
71entries regardless of their age; --expire=never turns off
72pruning of reachable entries (but see --expire-unreachable).
Junio C Hamano74640642006-12-27 10:59:5573
74--expire-unreachable=<time>::
Junio C Hamano54bf1e22008-12-20 06:30:1175Entries older than this time and not reachable from
Junio C Hamano74640642006-12-27 10:59:5576the current tip of the branch are pruned. Without the
77option it is taken from configuration
78`gc.reflogExpireUnreachable`, which in turn defaults to
Junio C Hamanoc7102962013-05-29 23:57:177930 days. --expire-unreachable=all prunes unreachable
80entries regardless of their age; --expire-unreachable=never
81turns off early pruning of unreachable entries (but see
82--expire).
Junio C Hamano74640642006-12-27 10:59:5583
84--all::
85Instead of listing <refs> explicitly, prune all refs.
86
Junio C Hamano86bcccc2008-03-08 09:33:5587--updateref::
88Update the ref with the sha1 of the top reflog entry (i.e.
89<ref>@\{0\}) after expiring or deleting.
90
91--rewrite::
92While expiring or deleting, adjust each reflog entry to ensure
93that the `old` sha1 field points to the `new` sha1 field of the
94previous entry.
95
Junio C Hamano764a6672007-10-23 01:23:3196--verbose::
97Print extra information on screen.
98
Junio C Hamano74640642006-12-27 10:59:5599GIT
100---
Junio C Hamanof7c042d2008-06-06 22:50:53101Part of the linkgit:git[1] suite