[core-workflow] instructions for cherrypicking a change from master

Chris Angelico rosuav at gmail.com
Thu Oct 6 21:55:46 EDT 2016


On Fri, Oct 7, 2016 at 6:44 AM, Brett Cannon <brett at snarky.ca> wrote:
> Since we're going with a cherrypicking for managing changes that apply to
> multiple versions of Python, we need to come up with the set of instructions
> on how to take e.g. a change committed in master and cherrypick it into 3.6.
> Anyone have such a set of instructions handy?

Check out the branch you want to cherry-pick into.
$ git checkout 3.6
Grab the commit you want
$ git cherry-pick 142a57
Make sure it looks good, and then push.

You can identify the commit in a variety of ways; if you just
committed it to master, you can identify the commit as 'master'.
(Don't confuse 'git merge master' and 'git cherry-pick master'; the
former says "merge in everything that the master branch has" or "merge
in the *content* from the master branch", while the latter says "grab
the top commit at branch master".)

If you want to, you can 'git cherry-pick -x 142a57', which will add a
linking comment to the commit that it creates, saying where it came
from.

ChrisA


More information about the core-workflow mailing list