Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What 'cherry' means in git-cherry?

What is the meaning of the word cherry in git-cherry?


Besides the fruit, I've only seem the word in the cherry picking expression (also present in git with git-cherry-pick), that means selectively picking something (right?).

Doesn't look like to me that cherry in git-cherry is related to the fruit neither to cherry pick.

I'm Brazilian so subtleties of the English language are not quite so obvious sometimes.

like image 260
talles Avatar asked Dec 11 '13 16:12

talles


1 Answers

It's called cherry-pick because the task is like cherry picking. You look through a bunch of commits (in a real tree, leaves and branches) and carefully select some of them. It's a delicate job the same way cherry picking in real-world is.

git-cherry is related to git-cherry-pick. git-cherry reports which commits do not exist in a branch. In other words, it returns which commits can be cherry-picked, i.e. which commits are cherries (so they can be picked).

like image 106
Shahbaz Avatar answered Oct 11 '22 10:10

Shahbaz