Git Cherry Pick Quick Steps & Overview

Nauman Tariq
2 min readMay 5, 2022

There’s a quick patch you need to deploy. However, there are many other commits on your develop branch, which you may not want to release immediately or they might belong to a major release

To merge your commits into the master/main branch, cherry pick your commits

Few simple steps

  1. First update your develop branch (this is where you merge all your development branches)
> git checkout develop
> git pull

2. If any merge conflicts, resolve them

3. Git pull to make sure you should have all changes and its upto date.

4. You can git log and get the sha value for the commit you want to merge with by cherry picking only the commits you wish to mergefe864bf .

5. If conflict raises, fix it and continue.

> git checkout master
> git pull
> git cherry-pick fe864bf
> git cherry-pick continue #if conflict, after resolve you need to run this
> git push #push to master hand picked, cherry-pick commits
Cherry-pick Conflict

That’s all you need to do! Enjoy cherry picking.

--

--