]>
Commit | Line | Data |
---|---|---|
4aec56d1 JH |
1 | git-reflog(1) |
2 | ============= | |
3 | ||
4 | NAME | |
5 | ---- | |
6 | git-reflog - Manage reflog information | |
7 | ||
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
cf39f54e | 11 | 'git reflog' <subcommand> <options> |
4aec56d1 JH |
12 | |
13 | DESCRIPTION | |
14 | ----------- | |
cf39f54e LT |
15 | The command takes various subcommands, and different options |
16 | depending on the subcommand: | |
17 | ||
18 | [verse] | |
04c2407e | 19 | 'git reflog expire' [--dry-run] [--stale-fix] [--verbose] |
cf39f54e | 20 | [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>... |
04c2407e JN |
21 | + |
22 | 'git reflog delete' ref@\{specifier\}... | |
23 | + | |
24 | 'git reflog' ['show'] [log-options] [<ref>] | |
4aec56d1 JH |
25 | |
26 | Reflog is a mechanism to record when the tip of branches are | |
27 | updated. This command is to manage the information recorded in it. | |
28 | ||
29 | The subcommand "expire" is used to prune older reflog entries. | |
30 | Entries older than `expire` time, or entries older than | |
04c8ce9c | 31 | `expire-unreachable` time and not reachable from the current |
4aec56d1 | 32 | tip, are removed from the reflog. This is typically not used |
5162e697 | 33 | directly by the end users -- instead, see linkgit:git-gc[1]. |
4aec56d1 | 34 | |
02783075 | 35 | The subcommand "show" (which is also the default, in the absence of any |
cf39f54e | 36 | subcommands) will take all the normal log options, and show the log of |
97e92e2c MM |
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 | |
db5d6666 | 39 | as well). It is an alias for `git log -g --abbrev-commit --pretty=oneline`; |
5162e697 | 40 | see linkgit:git-log[1]. |
97e92e2c MM |
41 | |
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 | |
5162e697 | 45 | point to one week ago", and so on. See linkgit:git-rev-parse[1] for |
97e92e2c | 46 | more details. |
4aec56d1 | 47 | |
552cecc2 | 48 | To delete single entries from the reflog, use the subcommand "delete" |
db5d6666 | 49 | and specify the _exact_ entry (e.g. "`git reflog delete master@\{2\}`"). |
552cecc2 | 50 | |
4aec56d1 JH |
51 | |
52 | OPTIONS | |
53 | ------- | |
54 | ||
cb877cd7 JN |
55 | --stale-fix:: |
56 | This revamps the logic -- the definition of "broken commit" | |
57 | becomes: a commit that is not reachable from any of the refs and | |
58 | there is a missing object among the commit, tree, or blob | |
59 | objects reachable from it that is not reachable from any of the | |
60 | refs. | |
61 | + | |
62 | This computation involves traversing all the reachable objects, i.e. it | |
467c0197 | 63 | has the same cost as 'git-prune'. Fortunately, once this is run, we |
cb877cd7 JN |
64 | should not have to ever worry about missing objects, because the current |
65 | prune and pack-objects know about reflogs and protect objects referred by | |
66 | them. | |
67 | ||
4aec56d1 JH |
68 | --expire=<time>:: |
69 | Entries older than this time are pruned. Without the | |
70 | option it is taken from configuration `gc.reflogExpire`, | |
71 | which in turn defaults to 90 days. | |
72 | ||
73 | --expire-unreachable=<time>:: | |
04c8ce9c | 74 | Entries older than this time and not reachable from |
4aec56d1 JH |
75 | the current tip of the branch are pruned. Without the |
76 | option it is taken from configuration | |
77 | `gc.reflogExpireUnreachable`, which in turn defaults to | |
78 | 30 days. | |
79 | ||
80 | --all:: | |
81 | Instead of listing <refs> explicitly, prune all refs. | |
82 | ||
cf2756ae BC |
83 | --updateref:: |
84 | Update the ref with the sha1 of the top reflog entry (i.e. | |
85 | <ref>@\{0\}) after expiring or deleting. | |
86 | ||
87 | --rewrite:: | |
88 | While expiring or deleting, adjust each reflog entry to ensure | |
89 | that the `old` sha1 field points to the `new` sha1 field of the | |
90 | previous entry. | |
91 | ||
a5d41015 MB |
92 | --verbose:: |
93 | Print extra information on screen. | |
94 | ||
4aec56d1 JH |
95 | Author |
96 | ------ | |
59eb68aa | 97 | Written by Junio C Hamano <gitster@pobox.com> |
4aec56d1 JH |
98 | |
99 | Documentation | |
100 | -------------- | |
101 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. | |
102 | ||
103 | GIT | |
104 | --- | |
9e1f0a85 | 105 | Part of the linkgit:git[1] suite |