revert: add tests to check cherry-picking many commits
[git/git.git] / Documentation / git-cherry-pick.txt
CommitLineData
215a7ad1
JH
1git-cherry-pick(1)
2==================
de2b82c6
JH
3
4NAME
5----
7bd7f280 6git-cherry-pick - Apply the change introduced by an existing commit
de2b82c6
JH
7
8SYNOPSIS
9--------
ab7e63e8 10'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>
de2b82c6
JH
11
12DESCRIPTION
13-----------
14Given one existing commit, apply the change the patch introduces, and record a
15new commit that records it. This requires your working tree to be clean (no
16modifications from the HEAD commit).
17
18OPTIONS
19-------
20<commit>::
21 Commit to cherry-pick.
483bc4f0 22 For a more complete list of ways to spell commits, see the
5162e697 23 "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
de2b82c6 24
3240240f
SB
25-e::
26--edit::
0b444cdb 27 With this option, 'git cherry-pick' will let you edit the commit
233808db 28 message prior to committing.
8bf14d6e 29
abd6970a 30-x::
dd8175f8
RW
31 When recording the commit, append to the original commit
32 message a note that indicates which commit this change
33 was cherry-picked from. Append the note only for cherry
34 picks without conflicts. Do not use this option if
35 you are cherry-picking from your private branch because
36 the information is useless to the recipient. If on the
abd6970a
JH
37 other hand you are cherry-picking between two publicly
38 visible branches (e.g. backporting a fix to a
39 maintenance branch for an older release from a
40 development branch), adding this information can be
41 useful.
42
6b04600a 43-r::
abd6970a
JH
44 It used to be that the command defaulted to do `-x`
45 described above, and `-r` was to disable it. Now the
46 default is not to do `-x` so this option is a no-op.
de2b82c6 47
3240240f
SB
48-m parent-number::
49--mainline parent-number::
84989bd8 50 Usually you cannot cherry-pick a merge because you do not know which
7791ecbc
JH
51 side of the merge should be considered the mainline. This
52 option specifies the parent number (starting from 1) of
53 the mainline and allows cherry-pick to replay the change
54 relative to the specified parent.
55
3240240f
SB
56-n::
57--no-commit::
37a7744f
BD
58 Usually the command automatically creates a commit.
59 This flag applies the change necessary to cherry-pick
60 the named commit to your working tree and the index,
61 but does not make the commit. In addition, when this
62 option is used, your index does not have to match the
63 HEAD commit. The cherry-pick is done against the
8bd867ee 64 beginning state of your index.
df8baa42
JF
65+
66This is useful when cherry-picking more than one commits'
8bd867ee 67effect to your index in a row.
de2b82c6 68
3240240f
SB
69-s::
70--signoff::
cfd9c277
DM
71 Add Signed-off-by line at the end of the commit message.
72
ab7e63e8
CC
73--ff::
74 If the current HEAD is the same as the parent of the
75 cherry-pick'ed commit, then a fast forward to this commit will
76 be performed.
de2b82c6
JH
77
78Author
79------
59eb68aa 80Written by Junio C Hamano <gitster@pobox.com>
de2b82c6
JH
81
82Documentation
83--------------
84Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
85
86GIT
87---
9e1f0a85 88Part of the linkgit:git[1] suite