'\" t
.\" Title: git-reflog
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 05/09/2012
.\" Manual: Git Manual
.\" Source: Git 1.6.4.3
.\" Language: English
.\"
.TH "GIT\-REFLOG" "1" "05/09/2012" "Git 1\&.6\&.4\&.3" "Git Manual"
.\" -----------------------------------------------------------------
.\" * 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
\fIgit reflog\fR
.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=] [\-\-expire\-unreachable=] [\-\-all] \&...
.fi
.if n \{\
.RE
.\}
.sp
+ \fIgit reflog delete\fR ref@{specifier}\&...
.sp
+ \fIgit reflog\fR [\fIshow\fR] [log\-options] []
.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@\e{2\e} means "where HEAD used to be two moves ago", master@\e{one\&.week\&.ago\e} means "where master used to point to one week ago", and so on\&. See \fBgit-rev-parse\fR(1) 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@\e{2\e}")\&.
.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=
.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\&.
.RE
.PP
\-\-expire\-unreachable=
.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\&.
.RE
.PP
\-\-all
.RS 4
Instead of listing explicitly, prune all refs\&.
.RE
.PP
\-\-updateref
.RS 4
Update the ref with the sha1 of the top reflog entry (i\&.e\&. @{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 "AUTHOR"
.sp
Written by Junio C Hamano
.SH "DOCUMENTATION"
.sp
Documentation by Junio C Hamano and the git\-list \&.
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite
.SH "NOTES"
.IP " 1." 4
gitster@pobox.com
.RS 4
\%mailto:gitster@pobox.com
.RE
.IP " 2." 4
git@vger.kernel.org
.RS 4
\%mailto:git@vger.kernel.org
.RE