1GIT-CHERRY-PICK(1) Git Manual GIT-CHERRY-PICK(1)
2
3
4
6 git-cherry-pick - Apply the change introduced by an existing commit
7
9 git cherry-pick [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
10 <commit>
11
13 Given one existing commit, apply the change the patch introduces, and
14 record a new commit that records it. This requires your working tree to
15 be clean (no modifications from the HEAD commit).
16
18 <commit>
19 Commit to cherry-pick. For a more complete list of ways to spell
20 commits, see the "SPECIFYING REVISIONS" section in git-rev-
21 parse(1).
22
23 -e, --edit
24 With this option, git cherry-pick will let you edit the commit
25 message prior to committing.
26
27 -x
28 When recording the commit, append to the original commit message a
29 note that indicates which commit this change was cherry-picked
30 from. Append the note only for cherry picks without conflicts. Do
31 not use this option if you are cherry-picking from your private
32 branch because the information is useless to the recipient. If on
33 the other hand you are cherry-picking between two publicly visible
34 branches (e.g. backporting a fix to a maintenance branch for an
35 older release from a development branch), adding this information
36 can be useful.
37
38 -r
39 It used to be that the command defaulted to do -x described above,
40 and -r was to disable it. Now the default is not to do -x so this
41 option is a no-op.
42
43 -m parent-number, --mainline parent-number
44 Usually you cannot cherry-pick a merge because you do not know
45 which side of the merge should be considered the mainline. This
46 option specifies the parent number (starting from 1) of the
47 mainline and allows cherry-pick to replay the change relative to
48 the specified parent.
49
50 -n, --no-commit
51 Usually the command automatically creates a commit. This flag
52 applies the change necessary to cherry-pick the named commit to
53 your working tree and the index, but does not make the commit. In
54 addition, when this option is used, your index does not have to
55 match the HEAD commit. The cherry-pick is done against the
56 beginning state of your index.
57
58 This is useful when cherry-picking more than one commits´ effect to
59 your index in a row.
60
61 -s, --signoff
62 Add Signed-off-by line at the end of the commit message.
63
64 --ff
65 If the current HEAD is the same as the parent of the cherry-pick’ed
66 commit, then a fast forward to this commit will be performed.
67
69 Written by Junio C Hamano <gitster@pobox.com[1]>
70
72 Documentation by Junio C Hamano and the git-list
73 <git@vger.kernel.org[2]>.
74
76 Part of the git(1) suite
77
79 1. gitster@pobox.com
80 mailto:gitster@pobox.com
81
82 2. git@vger.kernel.org
83 mailto:git@vger.kernel.org
84
85
86
87Git 1.7.1 08/16/2017 GIT-CHERRY-PICK(1)