blob: 937c4a79262d44583849fc81319187fa7fb65579 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-cherry-pick(1)
2==================
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-cherry-pick - Apply the change introduced by an existing commit
Junio C Hamano1a4e8412005-12-27 08:17:237
8SYNOPSIS
9--------
Junio C Hamanod814b6d2007-11-04 11:13:4910'git-cherry-pick' [--edit] [-n] [-m parent-number] [-x] <commit>
Junio C Hamano1a4e8412005-12-27 08:17:2311
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>::
21Commit to cherry-pick.
Junio C Hamano2d47c622007-01-18 06:24:1022For a more complete list of ways to spell commits, see
23"SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1].
Junio C Hamano1a4e8412005-12-27 08:17:2324
25-e|--edit::
26With this option, `git-cherry-pick` will let you edit the commit
27message prior committing.
28
Junio C Hamanoaf2b8c52006-10-06 01:00:4029-x::
Junio C Hamano764a6672007-10-23 01:23:3130When recording the commit, append to the original commit
31message a note that indicates which commit this change
32was cherry-picked from. Append the note only for cherry
33picks without conflicts. Do not use this option if
34you are cherry-picking from your private branch because
35the information is useless to the recipient. If on the
Junio C Hamanoaf2b8c52006-10-06 01:00:4036other hand you are cherry-picking between two publicly
37visible branches (e.g. backporting a fix to a
38maintenance branch for an older release from a
39development branch), adding this information can be
40useful.
41
Junio C Hamano81c711d2007-04-20 07:20:1442-r::
Junio C Hamanoaf2b8c52006-10-06 01:00:4043It used to be that the command defaulted to do `-x`
44described above, and `-r` was to disable it. Now the
45default is not to do `-x` so this option is a no-op.
Junio C Hamano1a4e8412005-12-27 08:17:2346
Junio C Hamanod814b6d2007-11-04 11:13:4947-m parent-number|--mainline parent-number::
48Usually you cannot revert a merge because you do not know which
49side of the merge should be considered the mainline. This
50option specifies the parent number (starting from 1) of
51the mainline and allows cherry-pick to replay the change
52relative to the specified parent.
53
Junio C Hamano1a4e8412005-12-27 08:17:2354-n|--no-commit::
55Usually the command automatically creates a commit with
56a commit log message stating which commit was
57cherry-picked. This flag applies the change necessary
58to cherry-pick the named commit to your working tree,
59but does not make the commit. In addition, when this
60option is used, your working tree does not have to match
61the HEAD commit. The cherry-pick is done against the
62beginning state of your working tree.
63+
64This is useful when cherry-picking more than one commits'
65effect to your working tree in a row.
66
67
68Author
69------
70Written by Junio C Hamano <junkio@cox.net>
71
72Documentation
73--------------
74Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
75
76GIT
77---
78Part of the gitlink:git[7] suite