Cherry-pick commits from one branch to another in Git

For those that don’t know (I recently find out myself), cherry-picking a specific commit from one branch to another couldn’t be simpler in Git. Recently I worked on a feature that needed to be merged into a release branch sooner than planned. The git commands are pretty straight-forward

git checkout http://you
git cherry-pick [commit]

Of course, if there are any merge conflicts you need to resolve them. In my specific case, I was working out of a feature branch in which myself and other developers had numerous commits against. We only needed a single commit to be picked out and merged into the release branch.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s