git-cherry.1   [plain text]


'\" t
.\"     Title: git-cherry
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 06/01/2011
.\"    Manual: Git Manual
.\"    Source: Git 1.7.5.4
.\"  Language: English
.\"
.TH "GIT\-CHERRY" "1" "06/01/2011" "Git 1\&.7\&.5\&.4" "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-cherry \- Find commits not merged upstream
.SH "SYNOPSIS"
.sp
\fIgit cherry\fR [\-v] [<upstream> [<head> [<limit>]]]
.SH "DESCRIPTION"
.sp
The changeset (or "diff") of each commit between the fork\-point and <head> is compared against each commit between the fork\-point and <upstream>\&. The commits are compared with their \fIpatch id\fR, obtained from the \fIgit patch\-id\fR program\&.
.sp
Every commit that doesn\(cqt exist in the <upstream> branch has its id (sha1) reported, prefixed by a symbol\&. The ones that have equivalent change already in the <upstream> branch are prefixed with a minus (\-) sign, and those that only exist in the <head> branch are prefixed with a plus (+) symbol:
.sp
.if n \{\
.RS 4
.\}
.nf
           __*__*__*__*__> <upstream>
          /
fork\-point
          \e__+__+__\-__+__+__\-__+__> <head>
.fi
.if n \{\
.RE
.\}
.sp
If a <limit> has been given then the commits along the <head> branch up to and including <limit> are not reported:
.sp
.if n \{\
.RS 4
.\}
.nf
           __*__*__*__*__> <upstream>
          /
fork\-point
          \e__*__*__<limit>__\-__+__> <head>
.fi
.if n \{\
.RE
.\}
.sp
Because \fIgit cherry\fR compares the changeset rather than the commit id (sha1), you can use \fIgit cherry\fR to find out if a commit you made locally has been applied <upstream> under a different commit id\&. For example, this will happen if you\(cqre feeding patches <upstream> via email rather than pushing or pulling commits directly\&.
.SH "OPTIONS"
.PP
\-v
.RS 4
Verbose\&.
.RE
.PP
<upstream>
.RS 4
Upstream branch to compare against\&. Defaults to the first tracked remote branch, if available\&.
.RE
.PP
<head>
.RS 4
Working branch; defaults to HEAD\&.
.RE
.PP
<limit>
.RS 4
Do not report commits up to (and including) limit\&.
.RE
.SH "SEE ALSO"
.sp
\fBgit-patch-id\fR(1)
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite