blob: e50bd9b68d80e9be997de80252dec5afbb7452b4 [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 Hamanod3339982007-02-09 08:38:4811'git reflog' <subcommand> <options>
Junio C Hamano74640642006-12-27 10:59:5512
13DESCRIPTION
14-----------
Junio C Hamanod3339982007-02-09 08:38:4815The command takes various subcommands, and different options
16depending on the subcommand:
17
18[verse]
Junio C Hamanoba4b9282008-07-06 05:20:3119'git reflog expire' [--dry-run] [--stale-fix] [--verbose]
Junio C Hamanod3339982007-02-09 08:38:4820[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...
Junio C Hamanoba4b9282008-07-06 05:20:3121'git reflog delete' ref@\{specifier\}...
Junio C Hamanoba4b9282008-07-06 05:20:3122'git reflog' ['show'] [log-options] [<ref>]
Junio C Hamano74640642006-12-27 10:59:5523
24Reflog is a mechanism to record when the tip of branches are
25updated. This command is to manage the information recorded in it.
26
27The subcommand "expire" is used to prune older reflog entries.
28Entries older than `expire` time, or entries older than
Junio C Hamano54bf1e22008-12-20 06:30:1129`expire-unreachable` time and not reachable from the current
Junio C Hamano74640642006-12-27 10:59:5530tip, are removed from the reflog. This is typically not used
Junio C Hamano35738e82008-01-07 07:55:4631directly by the end users -- instead, see linkgit:git-gc[1].
Junio C Hamano74640642006-12-27 10:59:5532
Junio C Hamanoa6387422007-08-25 03:54:2733The subcommand "show" (which is also the default, in the absence of any
Junio C Hamanod3339982007-02-09 08:38:4834subcommands) will take all the normal log options, and show the log of
Junio C Hamano2e72a942007-11-21 08:54:4235the reference provided in the command-line (or `HEAD`, by default).
36The reflog will cover all recent actions (HEAD reflog records branch switching
Junio C Hamanoba4b9282008-07-06 05:20:3137as well). It is an alias for `git log -g --abbrev-commit --pretty=oneline`;
Junio C Hamano35738e82008-01-07 07:55:4638see linkgit:git-log[1].
Junio C Hamano2e72a942007-11-21 08:54:4239
40The reflog is useful in various git commands, to specify the old value
41of a reference. For example, `HEAD@\{2\}` means "where HEAD used to be
42two moves ago", `master@\{one.week.ago\}` means "where master used to
Junio C Hamanoc27b7332010-10-14 04:37:2843point to one week ago", and so on. See linkgit:gitrevisions[7] for
Junio C Hamano2e72a942007-11-21 08:54:4244more details.
Junio C Hamano74640642006-12-27 10:59:5545
Junio C Hamano86bcccc2008-03-08 09:33:5546To delete single entries from the reflog, use the subcommand "delete"
Junio C Hamanoba4b9282008-07-06 05:20:3147and specify the _exact_ entry (e.g. "`git reflog delete master@\{2\}`").
Junio C Hamano86bcccc2008-03-08 09:33:5548
Junio C Hamano74640642006-12-27 10:59:5549
50OPTIONS
51-------
52
Junio C Hamanoee695f22007-06-21 00:35:3653--stale-fix::
54This revamps the logic -- the definition of "broken commit"
55becomes: a commit that is not reachable from any of the refs and
56there is a missing object among the commit, tree, or blob
57objects reachable from it that is not reachable from any of the
58refs.
59+
60This computation involves traversing all the reachable objects, i.e. it
Junio C Hamano1aa40d22010-01-21 17:46:4361has the same cost as 'git prune'. Fortunately, once this is run, we
Junio C Hamanoee695f22007-06-21 00:35:3662should not have to ever worry about missing objects, because the current
63prune and pack-objects know about reflogs and protect objects referred by
64them.
65
Junio C Hamano74640642006-12-27 10:59:5566--expire=<time>::
67Entries older than this time are pruned. Without the
68option it is taken from configuration `gc.reflogExpire`,
69which in turn defaults to 90 days.
70
71--expire-unreachable=<time>::
Junio C Hamano54bf1e22008-12-20 06:30:1172Entries older than this time and not reachable from
Junio C Hamano74640642006-12-27 10:59:5573the current tip of the branch are pruned. Without the
74option it is taken from configuration
75`gc.reflogExpireUnreachable`, which in turn defaults to
7630 days.
77
78--all::
79Instead of listing <refs> explicitly, prune all refs.
80
Junio C Hamano86bcccc2008-03-08 09:33:5581--updateref::
82Update the ref with the sha1 of the top reflog entry (i.e.
83<ref>@\{0\}) after expiring or deleting.
84
85--rewrite::
86While expiring or deleting, adjust each reflog entry to ensure
87that the `old` sha1 field points to the `new` sha1 field of the
88previous entry.
89
Junio C Hamano764a6672007-10-23 01:23:3190--verbose::
91Print extra information on screen.
92
Junio C Hamano74640642006-12-27 10:59:5593Author
94------
Junio C Hamano0868a302008-07-22 09:20:4495Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamano74640642006-12-27 10:59:5596
97Documentation
98--------------
99Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
100
101GIT
102---
Junio C Hamanof7c042d2008-06-06 22:50:53103Part of the linkgit:git[1] suite