blob: b764130d26eb750d2b5173dcc98366828e413046 [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 Hamanofce7c7e2008-07-02 03:06:3810'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-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 Hamanofce7c7e2008-07-02 03:06:3822For a more complete list of ways to spell commits, see the
Junio C Hamano35738e82008-01-07 07:55:4623"SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
Junio C Hamano1a4e8412005-12-27 08:17:2324
Junio C Hamanoeb415992008-06-08 22:49:4725-e::
26--edit::
Junio C Hamanoba4b9282008-07-06 05:20:3127With this option, 'git-cherry-pick' will let you edit the commit
Junio C Hamano0e661132008-01-21 02:37:4428message prior to committing.
Junio C Hamano1a4e8412005-12-27 08:17:2329
Junio C Hamanoaf2b8c52006-10-06 01:00:4030-x::
Junio C Hamano764a6672007-10-23 01:23:3131When recording the commit, append to the original commit
32message a note that indicates which commit this change
33was cherry-picked from. Append the note only for cherry
34picks without conflicts. Do not use this option if
35you are cherry-picking from your private branch because
36the information is useless to the recipient. If on the
Junio C Hamanoaf2b8c52006-10-06 01:00:4037other hand you are cherry-picking between two publicly
38visible branches (e.g. backporting a fix to a
39maintenance branch for an older release from a
40development branch), adding this information can be
41useful.
42
Junio C Hamano81c711d2007-04-20 07:20:1443-r::
Junio C Hamanoaf2b8c52006-10-06 01:00:4044It used to be that the command defaulted to do `-x`
45described above, and `-r` was to disable it. Now the
46default is not to do `-x` so this option is a no-op.
Junio C Hamano1a4e8412005-12-27 08:17:2347
Junio C Hamanoeb415992008-06-08 22:49:4748-m parent-number::
49--mainline parent-number::
Junio C Hamano69a98582008-03-01 18:42:1850Usually you cannot cherry-pick a merge because you do not know which
Junio C Hamanod814b6d2007-11-04 11:13:4951side of the merge should be considered the mainline. This
52option specifies the parent number (starting from 1) of
53the mainline and allows cherry-pick to replay the change
54relative to the specified parent.
55
Junio C Hamanoeb415992008-06-08 22:49:4756-n::
57--no-commit::
Junio C Hamano8dae8cd2008-11-24 05:38:5558Usually the command automatically creates a commit.
59This flag applies the change necessary to cherry-pick
60the named commit to your working tree and the index,
61but does not make the commit. In addition, when this
62option is used, your index does not have to match the
63HEAD commit. The cherry-pick is done against the
Junio C Hamanof69a0a02008-07-17 08:08:4764beginning state of your index.
Junio C Hamano1a4e8412005-12-27 08:17:2365+
66This is useful when cherry-picking more than one commits'
Junio C Hamanof69a0a02008-07-17 08:08:4767effect to your index in a row.
Junio C Hamano1a4e8412005-12-27 08:17:2368
Junio C Hamanoeb415992008-06-08 22:49:4769-s::
70--signoff::
Junio C Hamano6d76d612008-05-09 05:46:0871Add Signed-off-by line at the end of the commit message.
72
Junio C Hamano1a4e8412005-12-27 08:17:2373
74Author
75------
Junio C Hamano0868a302008-07-22 09:20:4476Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamano1a4e8412005-12-27 08:17:2377
78Documentation
79--------------
80Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
81
82GIT
83---
Junio C Hamanof7c042d2008-06-06 22:50:5384Part of the linkgit:git[1] suite