1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <article lang="en" id="git-cherry(1)">
\r
6 <title>git-cherry(1)</title>
\r
8 <primary>git-cherry(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-cherry - Find commits not merged upstream</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git cherry</emphasis> [-v] [<upstream> [<head> [<limit>]]]</literallayout>
\r
21 <simplesect id="_description">
\r
22 <title>DESCRIPTION</title>
\r
23 <simpara>The changeset (or "diff") of each commit between the fork-point and <head>
\r
24 is compared against each commit between the fork-point and <upstream>.
\r
25 The commits are compared with their <emphasis>patch id</emphasis>, obtained from
\r
26 the <emphasis>git patch-id</emphasis> program.</simpara>
\r
27 <simpara>Every commit that doesn't exist in the <upstream> branch
\r
28 has its id (sha1) reported, prefixed by a symbol. The ones that have
\r
29 equivalent change already
\r
30 in the <upstream> branch are prefixed with a minus (-) sign, and those
\r
31 that only exist in the <head> branch are prefixed with a plus (+) symbol:</simpara>
\r
32 <literallayout class="monospaced"> __*__*__*__*__> <upstream>
\r
35 \__+__+__-__+__+__-__+__> <head></literallayout>
\r
36 <simpara>If a <limit> has been given then the commits along the <head> branch up
\r
37 to and including <limit> are not reported:</simpara>
\r
38 <literallayout class="monospaced"> __*__*__*__*__> <upstream>
\r
41 \__*__*__<limit>__-__+__> <head></literallayout>
\r
42 <simpara>Because <emphasis>git cherry</emphasis> compares the changeset rather than the commit id
\r
43 (sha1), you can use <emphasis>git cherry</emphasis> to find out if a commit you made locally
\r
44 has been applied <upstream> under a different commit id. For example,
\r
45 this will happen if you're feeding patches <upstream> via email rather
\r
46 than pushing or pulling commits directly.</simpara>
\r
48 <simplesect id="_options">
\r
49 <title>OPTIONS</title>
\r
67 Upstream branch to compare against.
\r
68 Defaults to the first tracked remote branch, if available.
\r
78 Working branch; defaults to HEAD.
\r
88 Do not report commits up to (and including) limit.
\r
94 <simplesect id="_see_also">
\r
95 <title>SEE ALSO</title>
\r
96 <simpara><xref linkend="git-patch-id(1)" /></simpara>
\r
98 <simplesect id="_git">
\r
100 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r