| 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 | af2b8c5 | 2006-10-06 01:00:40 | [diff] [blame] | 10 | 'git-cherry-pick' [--edit] [-n] [-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 | 2d47c62 | 2007-01-18 06:24:10 | [diff] [blame] | 22 | For a more complete list of ways to spell commits, see |
| 23 | "SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1]. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 24 | |
| 25 | -e|--edit:: |
| 26 | With this option, `git-cherry-pick` will let you edit the commit |
| 27 | message prior committing. |
| 28 | |
| Junio C Hamano | af2b8c5 | 2006-10-06 01:00:40 | [diff] [blame] | 29 | -x:: |
| Junio C Hamano | 764a667 | 2007-10-23 01:23:31 | [diff] [blame] | 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 |
| Junio C Hamano | af2b8c5 | 2006-10-06 01:00:40 | [diff] [blame] | 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 | |
| Junio C Hamano | 81c711d | 2007-04-20 07:20:14 | [diff] [blame] | 42 | -r:: |
| Junio C Hamano | af2b8c5 | 2006-10-06 01:00:40 | [diff] [blame] | 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. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 46 | |
| 47 | -n|--no-commit:: |
| 48 | Usually the command automatically creates a commit with |
| 49 | a commit log message stating which commit was |
| 50 | cherry-picked. This flag applies the change necessary |
| 51 | to cherry-pick the named commit to your working tree, |
| 52 | but does not make the commit. In addition, when this |
| 53 | option is used, your working tree does not have to match |
| 54 | the HEAD commit. The cherry-pick is done against the |
| 55 | beginning state of your working tree. |
| 56 | + |
| 57 | This is useful when cherry-picking more than one commits' |
| 58 | effect to your working tree in a row. |
| 59 | |
| 60 | |
| 61 | Author |
| 62 | ------ |
| 63 | Written by Junio C Hamano <junkio@cox.net> |
| 64 | |
| 65 | Documentation |
| 66 | -------------- |
| 67 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 68 | |
| 69 | GIT |
| 70 | --- |
| 71 | Part of the gitlink:git[7] suite |