🍒What IS git cherry-pick? 🍒

What is cherry-pick

git-cherry-pick — Apply the changes introduced by some existing commits

https://git-scm.com/docs/git-cherry-pick

$ git cherry-pick [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
[-S[<keyid>]] <commit>…​
$ git cherry-pick (--continue | --skip | --abort | --quit)

[Use case]
You are working on a branch from develop and your co-worker is also working on a branch from develop. He/She has fixed an issue(commit ID xxxyyyzzz000). You want to take in that bug fix from his/her branch, but you don't want to take in some commit he/she did.

Diff between merge and cherry-pick

Image for post
Image for post
$ git cherry-pick 61240658a3f26bd3b69cb961de4da9ef363fff35 # commit ID

How to check commit ID

$ git logcommit 61240658a3f26bd3b69cb961de4da9ef363fff35
Author: Koji <>
Date: Thu Sep 24 16:41:16 2020 -0400
Update programming.pycommit d85d4ddc01f2a28205c3e57abe8fe38f378f4857
Author: Koji <>
Date: Thu Sep 24 14:54:23 2020 -0400
Update programming.py

By the way, basically, you don’t need the entire commit ID.
You just need around 6 digits from the end that GitHub shows on a repo.

Go to your repo and check your commits on a branch

Image for post
Image for post

Written by

#CreativeCoding #Art #PhysicalComputing #IoT #MachineLearning #python #creativetech

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store