git-reflog.1   [plain text]


'\" t
.\"     Title: git-reflog
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 02/24/2014
.\"    Manual: Git Manual
.\"    Source: Git 1.9.0
.\"  Language: English
.\"
.TH "GIT\-REFLOG" "1" "02/24/2014" "Git 1\&.9\&.0" "Git Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-reflog \- Manage reflog information
.SH "SYNOPSIS"
.sp
.nf
\fIgit reflog\fR <subcommand> <options>
.fi
.sp
.SH "DESCRIPTION"
.sp
The command takes various subcommands, and different options depending on the subcommand:
.sp
.if n \{\
.RS 4
.\}
.nf
\fIgit reflog expire\fR [\-\-dry\-run] [\-\-stale\-fix] [\-\-verbose]
        [\-\-expire=<time>] [\-\-expire\-unreachable=<time>] [\-\-all] <refs>\&...
\fIgit reflog delete\fR ref@{specifier}\&...
\fIgit reflog\fR [\fIshow\fR] [log\-options] [<ref>]
.fi
.if n \{\
.RE
.\}
.sp
.sp
Reflog is a mechanism to record when the tip of branches are updated\&. This command is to manage the information recorded in it\&.
.sp
The subcommand "expire" is used to prune 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 the end users \(em instead, see \fBgit-gc\fR(1)\&.
.sp
The subcommand "show" (which is also the default, in the absence of any subcommands) will take all the normal log options, and show the log of the reference provided in the command\-line (or HEAD, by default)\&. The reflog will cover all recent actions (HEAD reflog records branch switching as well)\&. It is an alias for git log \-g \-\-abbrev\-commit \-\-pretty=oneline; see \fBgit-log\fR(1)\&.
.sp
The reflog is 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", and so on\&. See \fBgitrevisions\fR(7) for more details\&.
.sp
To delete single entries from the reflog, use the subcommand "delete" and specify the \fIexact\fR entry (e\&.g\&. "git reflog delete master@{2}")\&.
.SH "OPTIONS"
.PP
\-\-stale\-fix
.RS 4
This revamps the logic \(em the definition of "broken commit" becomes: a commit that is not reachable from any of the refs and there is a missing object among the commit, tree, or blob objects reachable from it that is not reachable from any of the refs\&.
.sp
This computation involves traversing all the reachable objects, i\&.e\&. it has the same cost as
\fIgit prune\fR\&. Fortunately, once this is run, we should not have to ever worry about missing objects, because the current prune and pack\-objects know about reflogs and protect objects referred by them\&.
.RE
.PP
\-\-expire=<time>
.RS 4
Entries older than this time are pruned\&. Without the option it is taken from configuration
gc\&.reflogExpire, which in turn defaults to 90 days\&. \-\-expire=all prunes entries regardless of their age; \-\-expire=never turns off pruning of reachable entries (but see \-\-expire\-unreachable)\&.
.RE
.PP
\-\-expire\-unreachable=<time>
.RS 4
Entries older than this time and not reachable from the current tip of the branch are pruned\&. Without the option it is taken from configuration
gc\&.reflogExpireUnreachable, which in turn defaults to 30 days\&. \-\-expire\-unreachable=all prunes unreachable entries regardless of their age; \-\-expire\-unreachable=never turns off early pruning of unreachable entries (but see \-\-expire)\&.
.RE
.PP
\-\-all
.RS 4
Instead of listing <refs> explicitly, prune all refs\&.
.RE
.PP
\-\-updateref
.RS 4
Update the ref with the sha1 of the top reflog entry (i\&.e\&. <ref>@{0}) after expiring or deleting\&.
.RE
.PP
\-\-rewrite
.RS 4
While expiring or deleting, adjust each reflog entry to ensure that the
old
sha1 field points to the
new
sha1 field of the previous entry\&.
.RE
.PP
\-\-verbose
.RS 4
Print extra information on screen\&.
.RE
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite