]> git.ipfire.org Git - thirdparty/git.git/blob - Documentation/git-cherry-pick.txt
Documentation: be consistent about "git-" versus "git "
[thirdparty/git.git] / Documentation / git-cherry-pick.txt
1 git-cherry-pick(1)
2 ==================
3
4 NAME
5 ----
6 git-cherry-pick - Apply the change introduced by an existing commit
7
8 SYNOPSIS
9 --------
10 'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] <commit>
11
12 DESCRIPTION
13 -----------
14 Given one existing commit, apply the change the patch introduces, and record a
15 new commit that records it. This requires your working tree to be clean (no
16 modifications from the HEAD commit).
17
18 OPTIONS
19 -------
20 <commit>::
21 Commit to cherry-pick.
22 For a more complete list of ways to spell commits, see
23 "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
24
25 -e::
26 --edit::
27 With this option, `git-cherry-pick` will let you edit the commit
28 message prior to committing.
29
30 -x::
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
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
43 -r::
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.
47
48 -m parent-number::
49 --mainline parent-number::
50 Usually you cannot cherry-pick a merge because you do not know which
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
56 -n::
57 --no-commit::
58 Usually the command automatically creates a commit with
59 a commit log message stating which commit was
60 cherry-picked. This flag applies the change necessary
61 to cherry-pick the named commit to your working tree,
62 but does not make the commit. In addition, when this
63 option is used, your working tree does not have to match
64 the HEAD commit. The cherry-pick is done against the
65 beginning state of your working tree.
66 +
67 This is useful when cherry-picking more than one commits'
68 effect to your working tree in a row.
69
70 -s::
71 --signoff::
72 Add Signed-off-by line at the end of the commit message.
73
74
75 Author
76 ------
77 Written by Junio C Hamano <junkio@cox.net>
78
79 Documentation
80 --------------
81 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
82
83 GIT
84 ---
85 Part of the linkgit:git[1] suite