Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-cherry-pick(1) |
| 2 | ================== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 6 | git-cherry-pick - Apply the change introduced by an existing commit |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 10 | 'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] <commit> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 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. |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 22 | For a more complete list of ways to spell commits, see the |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 23 | "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1]. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 24 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 25 | -e:: |
| 26 | --edit:: |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 27 | With this option, 'git-cherry-pick' will let you edit the commit |
Junio C Hamano | 0e66113 | 2008-01-21 02:37:44 | [diff] [blame] | 28 | message prior to committing. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 29 | |
Junio C Hamano | af2b8c5 | 2006-10-06 01:00:40 | [diff] [blame] | 30 | -x:: |
Junio C Hamano | 764a667 | 2007-10-23 01:23:31 | [diff] [blame] | 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 |
Junio C Hamano | af2b8c5 | 2006-10-06 01:00:40 | [diff] [blame] | 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 | |
Junio C Hamano | 81c711d | 2007-04-20 07:20:14 | [diff] [blame] | 43 | -r:: |
Junio C Hamano | af2b8c5 | 2006-10-06 01:00:40 | [diff] [blame] | 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. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 47 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 48 | -m parent-number:: |
| 49 | --mainline parent-number:: |
Junio C Hamano | 69a9858 | 2008-03-01 18:42:18 | [diff] [blame] | 50 | Usually you cannot cherry-pick a merge because you do not know which |
Junio C Hamano | d814b6d | 2007-11-04 11:13:49 | [diff] [blame] | 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 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 56 | -n:: |
| 57 | --no-commit:: |
Junio C Hamano | 8dae8cd | 2008-11-24 05:38:55 | [diff] [blame] | 58 | Usually the command automatically creates a commit. |
| 59 | This flag applies the change necessary to cherry-pick |
| 60 | the named commit to your working tree and the index, |
| 61 | but does not make the commit. In addition, when this |
| 62 | option is used, your index does not have to match the |
| 63 | HEAD commit. The cherry-pick is done against the |
Junio C Hamano | f69a0a0 | 2008-07-17 08:08:47 | [diff] [blame] | 64 | beginning state of your index. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 65 | + |
| 66 | This is useful when cherry-picking more than one commits' |
Junio C Hamano | f69a0a0 | 2008-07-17 08:08:47 | [diff] [blame] | 67 | effect to your index in a row. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 68 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 69 | -s:: |
| 70 | --signoff:: |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 71 | Add Signed-off-by line at the end of the commit message. |
| 72 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 73 | |
| 74 | Author |
| 75 | ------ |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 76 | Written by Junio C Hamano <gitster@pobox.com> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 77 | |
| 78 | Documentation |
| 79 | -------------- |
| 80 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 81 | |
| 82 | GIT |
| 83 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 84 | Part of the linkgit:git[1] suite |