| 86 | |
| 87 | === Merge a single change from master into a release branch === |
| 88 | The equivalent to Subversion's `svn merge -c <revision> .` is `git cherry-pick`. Use `git cherry-pick` to merge a single change from master into a release branch. To do this, look up the commit ID of the commit you want to pick: |
| 89 | {{{ |
| 90 | git log |
| 91 | # copy the commit ID |
| 92 | }}} |
| 93 | Switch to the target branch of the cherry pick: |
| 94 | {{{ |
| 95 | git checkout release_2_3 |
| 96 | }}} |
| 97 | Cherry-pick the commit. It is good practice to pass `-x` to `git cherry-pick`, which will automatically add a "Cherry picked from commit <commmitID>" line to the commit message of your cherry pick. You will have the option to modify the commit message, e.g. to describe why the backport was necessary. |
| 98 | {{{ |
| 99 | git cherry-pick -x <commitID> |
| 100 | }}} |
| 101 | Finally, push the new commit using |
| 102 | {{{ |
| 103 | git push [origin <branchname>] |
| 104 | }}} |