Http://think-like-a-git.net/sections/rebase-from-the-ground-up/cherry-picking-explained.html
Git ' s own online help have a great, if characteristically terse, description of the command does:
Given one or more existing commits, apply the change from each one introduces, recording a new commits for each.
I ' ve already mentioned (back in the page about garbage collection) that a Git commit ' s ID was a hash of both its contents a nd its history. So, even if you have both commits that introduce the exact same change, if they point to different parent commits, they ' ll have different IDs.
What git cherry-pick
does, basically, was take a commit from somewhere else, and "Play it back" wherever you were right now. Because this introduces the same change with a different parent, Git builds a new commit with a different ID.
Let's go example from the reachability section:
If you were at node H in this graph, and you typed git cherry-pick E
(yes, you ' d actually type part or all of the SHA for the Comm It, but for simplicity ' s sake, I'll just use the labels that is already here), you ' d wind up with a copy of commit E -let's Call it "e-Prime" or E '-that pointed to H -s parent, like so:
Or, if you typed something like git cherry-pick C D E
, you ' d wind up with the this when you were done:
The important thing to notice are that Git have copied changes made in one place, and replayed them somewhere else.
Here's a quick slideshow that steps through the process:
There is a series of pictures in the original, want to see, can go to see the original
Git checks out the specified commit to the current branch from another branch