]>
Commit | Line | Data |
---|---|---|
215a7ad1 JH |
1 | git-cherry-pick(1) |
2 | ================== | |
de2b82c6 JH |
3 | |
4 | NAME | |
5 | ---- | |
7bd7f280 | 6 | git-cherry-pick - Apply the change introduced by an existing commit |
de2b82c6 JH |
7 | |
8 | SYNOPSIS | |
9 | -------- | |
7791ecbc | 10 | 'git-cherry-pick' [--edit] [-n] [-m parent-number] [-x] <commit> |
de2b82c6 JH |
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. | |
41a5564e | 22 | For a more complete list of ways to spell commits, see |
5162e697 | 23 | "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1]. |
de2b82c6 | 24 | |
674b2808 | 25 | -e|--edit:: |
8bf14d6e PB |
26 | With this option, `git-cherry-pick` will let you edit the commit |
27 | message prior committing. | |
28 | ||
abd6970a | 29 | -x:: |
dd8175f8 RW |
30 | When recording the commit, append to the original commit |
31 | message a note that indicates which commit this change | |
32 | was cherry-picked from. Append the note only for cherry | |
33 | picks without conflicts. Do not use this option if | |
34 | you are cherry-picking from your private branch because | |
35 | the information is useless to the recipient. If on the | |
abd6970a JH |
36 | other hand you are cherry-picking between two publicly |
37 | visible branches (e.g. backporting a fix to a | |
38 | maintenance branch for an older release from a | |
39 | development branch), adding this information can be | |
40 | useful. | |
41 | ||
6b04600a | 42 | -r:: |
abd6970a JH |
43 | It used to be that the command defaulted to do `-x` |
44 | described above, and `-r` was to disable it. Now the | |
45 | default is not to do `-x` so this option is a no-op. | |
de2b82c6 | 46 | |
7791ecbc JH |
47 | -m parent-number|--mainline parent-number:: |
48 | Usually you cannot revert a merge because you do not know which | |
49 | side of the merge should be considered the mainline. This | |
50 | option specifies the parent number (starting from 1) of | |
51 | the mainline and allows cherry-pick to replay the change | |
52 | relative to the specified parent. | |
53 | ||
d9722174 | 54 | -n|--no-commit:: |
de2b82c6 JH |
55 | Usually the command automatically creates a commit with |
56 | a commit log message stating which commit was | |
57 | cherry-picked. This flag applies the change necessary | |
58 | to cherry-pick the named commit to your working tree, | |
59 | but does not make the commit. In addition, when this | |
60 | option is used, your working tree does not have to match | |
61 | the HEAD commit. The cherry-pick is done against the | |
62 | beginning state of your working tree. | |
df8baa42 JF |
63 | + |
64 | This is useful when cherry-picking more than one commits' | |
65 | effect to your working tree in a row. | |
de2b82c6 JH |
66 | |
67 | ||
68 | Author | |
69 | ------ | |
70 | Written by Junio C Hamano <junkio@cox.net> | |
71 | ||
72 | Documentation | |
73 | -------------- | |
74 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. | |
75 | ||
76 | GIT | |
77 | --- | |
5162e697 | 78 | Part of the linkgit:git[7] suite |