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 [branch you want to cherrypick to]
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