Merge branch 'master' of git://git.kernel.org/pub/scm/git/git
[git/jnareb-git.git] / Documentation / git-reflog.txt
blobed4177be26a210f1f86b6b4c15e0663232d415c8
1 git-reflog(1)
2 =============
4 NAME
5 ----
6 git-reflog - Manage reflog information
9 SYNOPSIS
10 --------
11 'git reflog' <subcommand> <options>
13 DESCRIPTION
14 -----------
15 The command takes various subcommands, and different options
16 depending on the subcommand:
18 [verse]
19 git reflog expire [--dry-run] [--stale-fix] [--verbose]
20         [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...
22 git reflog [show] [log-options] [<ref>]
24 Reflog is a mechanism to record when the tip of branches are
25 updated.  This command is to manage the information recorded in it.
27 The subcommand "expire" is used to prune older reflog entries.
28 Entries older than `expire` time, or entries older than
29 `expire-unreachable` time and are not reachable from the current
30 tip, are removed from the reflog.  Entries which refer to
31 commits that are no longer in the repository are pruned
32 regardless of their age.  This command is typically not used
33 directly by the end users -- instead, see gitlink:git-gc[1].
35 The subcommand "show" (which is also the default, in the absence of any
36 subcommands) will take all the normal log options, and show the log of
37 the reference provided in the command-line (or `HEAD`, by default).
38 The reflog will cover all recent actions (HEAD reflog records branch switching
39 as well).  It is an alias for 'git log -g --abbrev-commit --pretty=oneline';
40 see gitlink:git-log[1].
42 The reflog is useful in various git commands, to specify the old value
43 of a reference. For example, `HEAD@\{2\}` means "where HEAD used to be
44 two moves ago", `master@\{one.week.ago\}` means "where master used to
45 point to one week ago", and so on. See gitlink:git-rev-parse[1] for
46 more details.
48 OPTIONS
49 -------
51 --stale-fix::
52         This revamps the logic -- the definition of "broken commit"
53         becomes: a commit that is not reachable from any of the refs and
54         there is a missing object among the commit, tree, or blob
55         objects reachable from it that is not reachable from any of the
56         refs.
58 This computation involves traversing all the reachable objects, i.e. it
59 has the same cost as 'git prune'.  Fortunately, once this is run, we
60 should not have to ever worry about missing objects, because the current
61 prune and pack-objects know about reflogs and protect objects referred by
62 them.
64 --expire=<time>::
65         Entries older than this time are pruned.  Without the
66         option it is taken from configuration `gc.reflogExpire`,
67         which in turn defaults to 90 days.
69 --expire-unreachable=<time>::
70         Entries older than this time and are not reachable from
71         the current tip of the branch are pruned.  Without the
72         option it is taken from configuration
73         `gc.reflogExpireUnreachable`, which in turn defaults to
74         30 days.
76 --all::
77         Instead of listing <refs> explicitly, prune all refs.
79 --verbose::
80         Print extra information on screen.
82 Author
83 ------
84 Written by Junio C Hamano <junkio@cox.net>
86 Documentation
87 --------------
88 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
90 GIT
91 ---
92 Part of the gitlink:git[7] suite