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