Home Explore Blog CI



git

1st chunk of `Documentation/git-reflog.adoc`
1370659191c3568d5f51477c1d8bbceab395d3ea6d9ef5ed0000000100000a40
git-reflog(1)
=============

NAME
----
git-reflog - Manage reflog information


SYNOPSIS
--------
[verse]
'git reflog' [show] [<log-options>] [<ref>]
'git reflog list'
'git reflog expire' [--expire=<time>] [--expire-unreachable=<time>]
	[--rewrite] [--updateref] [--stale-fix]
	[--dry-run | -n] [--verbose] [--all [--single-worktree] | <refs>...]
'git reflog delete' [--rewrite] [--updateref]
	[--dry-run | -n] [--verbose] <ref>@{<specifier>}...
'git reflog drop' [--all [--single-worktree] | <refs>...]
'git reflog exists' <ref>

DESCRIPTION
-----------
This command manages the information recorded in the reflogs.

Reference logs, or "reflogs", record when the tips of branches and
other references were updated in the local repository. Reflogs are
useful in various Git commands, to specify the old value of a
reference. For example, `HEAD@{2}` means "where HEAD used to be two
moves ago", `master@{one.week.ago}` means "where master used to point
to one week ago in this local repository", and so on. See
linkgit:gitrevisions[7] for more details.

The command takes various subcommands, and different options
depending on the subcommand:

The "show" subcommand (which is also the default, in the absence of
any subcommands) shows the log of the reference provided in the
command-line (or `HEAD`, by default). The reflog covers all recent
actions, and in addition the `HEAD` reflog records branch switching.
`git reflog show` is an alias for `git log -g --abbrev-commit
--pretty=oneline`; see linkgit:git-log[1] for more information.

The "list" subcommand lists all refs which have a corresponding reflog.

The "expire" subcommand prunes older reflog entries. Entries older
than `expire` time, or entries older than `expire-unreachable` time
and not reachable from the current tip, are removed from the reflog.
This is typically not used directly by end users -- instead, see
linkgit:git-gc[1].

The "delete" subcommand deletes single entries from the reflog, but
not the reflog itself. Its argument must be an _exact_ entry (e.g. "`git
reflog delete master@{2}`"). This subcommand is also typically not used
directly by end users.

The "drop" subcommand completely removes the reflog for the specified
references. This is in contrast to "expire" and "delete", both of which
can be used to delete reflog entries, but not the reflog itself.

The "exists" subcommand checks whether a ref has a reflog.  It exits
with zero status if the reflog exists, and non-zero status if it does
not.

OPTIONS
-------

Options for `show`
~~~~~~~~~~~~~~~~~~

`git reflog show` accepts any of the options accepted by `git log`.


Options

Title: Git Reflog Command
Summary
The git-reflog command is used to manage reflog information in a Git repository, including showing, listing, expiring, deleting, and dropping reflogs, which record updates to branches and other references in the local repository.