@@ -8,16 +8,17 @@ git-reflog - Manage reflog information
88
99SYNOPSIS
1010--------
11- [verse]
12- 'git reflog' [show] [<log-options >] [<ref >]
13- 'git reflog list'
14- 'git reflog expire' [-- expire=<time >] [-- expire-unreachable=<time >]
11+ [synopsis]
12+ git reflog [show] [<log-options >] [<ref >]
13+ git reflog list
14+ git reflog exists <ref >
15+ git reflog write <ref > <old-oid > <new-oid > <message >
16+ git reflog delete [-- rewrite] [-- updateref]
17+ [-- dry-run | -n] [-- verbose] <ref >@{<specifier >}...
18+ git reflog drop [-- all [-- single-worktree] | <refs >... ]
19+ git reflog expire [-- expire=<time >] [-- expire-unreachable=<time >]
1520 [-- rewrite] [-- updateref] [-- stale-fix]
1621 [-- dry-run | -n] [-- verbose] [-- all [-- single-worktree] | <refs >... ]
17- 'git reflog delete' [-- rewrite] [-- updateref]
18- [-- dry-run | -n] [-- verbose] <ref >@{<specifier >}...
19- 'git reflog drop' [-- all [-- single-worktree] | <refs >... ]
20- 'git reflog exists' <ref >
2122
2223DESCRIPTION
2324-----------
@@ -43,11 +44,15 @@ actions, and in addition the `HEAD` reflog records branch switching.
4344
4445The "list" subcommand lists all refs which have a corresponding reflog.
4546
46- The "expire" subcommand prunes older reflog entries. Entries older
47- than `expire` time, or entries older than `expire-unreachable` time
48- and not reachable from the current tip, are removed from the reflog.
49- This is typically not used directly by end users -- instead, see
50- linkgit:git-gc[1].
47+ The "exists" subcommand checks whether a ref has a reflog. It exits
48+ with zero status if the reflog exists, and non-zero status if it does
49+ not.
50+
51+ The "write" subcommand writes a single entry to the reflog of a given
52+ reference. This new entry is appended to the reflog and will thus become
53+ the most recent entry. The reference name must be fully qualified. Both the old
54+ and new object IDs must not be abbreviated and must point to existing objects.
55+ The reflog message gets normalized.
5156
5257The "delete" subcommand deletes single entries from the reflog, but
5358not the reflog itself. Its argument must be an _exact_ entry (e.g. "`git
@@ -58,9 +63,11 @@ The "drop" subcommand completely removes the reflog for the specified
5863references. This is in contrast to "expire" and "delete", both of which
5964can be used to delete reflog entries, but not the reflog itself.
6065
61- The "exists" subcommand checks whether a ref has a reflog. It exits
62- with zero status if the reflog exists, and non-zero status if it does
63- not.
66+ The "expire" subcommand prunes older reflog entries. Entries older
67+ than `expire` time, or entries older than `expire-unreachable` time
68+ and not reachable from the current tip, are removed from the reflog.
69+ This is typically not used directly by end users -- instead, see
70+ linkgit:git-gc[1].
6471
6572OPTIONS
6673-------
@@ -71,26 +78,45 @@ Options for `show`
7178`git reflog show` accepts any of the options accepted by `git log` .
7279
7380
81+ Options for `delete`
82+ ~~~~~~~~~~~~~~~~~~~~
83+
84+ `git reflog delete` accepts options `--updateref` , `--rewrite` , `-n` ,
85+ `--dry-run` , and `--verbose` , with the same meanings as when they are
86+ used with `expire` .
87+
88+ Options for `drop`
89+ ~~~~~~~~~~~~~~~~~~
90+
91+ `--all` ::
92+ Drop the reflogs of all references from all worktrees.
93+
94+ `--single-worktree` ::
95+ By default when `--all` is specified, reflogs from all working
96+ trees are dropped. This option limits the processing to reflogs
97+ from the current working tree only.
98+
99+
74100Options for `expire`
75101~~~~~~~~~~~~~~~~~~~~
76102
77- -- all::
103+ ` --all` ::
78104 Process the reflogs of all references.
79105
80- -- single-worktree::
106+ ` --single-worktree` ::
81107 By default when `--all` is specified, reflogs from all working
82108 trees are processed. This option limits the processing to reflogs
83109 from the current working tree only.
84110
85- -- expire=<time >::
111+ ` --expire=<time>` ::
86112 Prune entries older than the specified time. If this option is
87113 not specified, the expiration time is taken from the
88114 configuration setting `gc.reflogExpire` , which in turn
89115 defaults to 90 days. `--expire=all` prunes entries regardless
90116 of their age; `--expire=never` turns off pruning of reachable
91117 entries (but see `--expire-unreachable` ).
92118
93- -- expire-unreachable=<time >::
119+ ` --expire-unreachable=<time>` ::
94120 Prune entries older than `<time>` that are not reachable from
95121 the current tip of the branch. If this option is not
96122 specified, the expiration time is taken from the configuration
@@ -100,17 +126,17 @@ Options for `expire`
100126 turns off early pruning of unreachable entries (but see
101127 `--expire` ).
102128
103- -- updateref::
129+ ` --updateref` ::
104130 Update the reference to the value of the top reflog entry (i.e.
105131 <ref >@\{ 0\} ) if the previous top entry was pruned. (This
106132 option is ignored for symbolic references.)
107133
108- -- rewrite::
134+ ` --rewrite` ::
109135 If a reflog entry's predecessor is pruned, adjust its "old"
110136 SHA-1 to be equal to the "new" SHA-1 field of the entry that
111137 now precedes it.
112138
113- -- stale-fix::
139+ ` --stale-fix` ::
114140 Prune any reflog entries that point to "broken commits". A
115141 broken commit is a commit that is not reachable from any of
116142 the reference tips and that refers, directly or indirectly, to
@@ -121,33 +147,15 @@ has the same cost as 'git prune'. It is primarily intended to fix
121147corruption caused by garbage collecting using older versions of Git,
122148which didn't protect objects referred to by reflogs.
123149
124- -n ::
125- -- dry-run::
150+ `-n` ::
151+ ` --dry-run` ::
126152 Do not actually prune any entries; just show what would have
127153 been pruned.
128154
129- -- verbose::
155+ ` --verbose` ::
130156 Print extra information on screen.
131157
132158
133- Options for `delete`
134- ~~~~~~~~~~~~~~~~~~~~
135-
136- `git reflog delete` accepts options `--updateref` , `--rewrite` , `-n` ,
137- `--dry-run` , and `--verbose` , with the same meanings as when they are
138- used with `expire` .
139-
140- Options for `drop`
141- ~~~~~~~~~~~~~~~~~~
142-
143- -- all::
144- Drop the reflogs of all references from all worktrees.
145-
146- -- single-worktree::
147- By default when `--all` is specified, reflogs from all working
148- trees are dropped. This option limits the processing to reflogs
149- from the current working tree only.
150-
151159GIT
152160---
153161Part of the linkgit:git[1] suite
0 commit comments