What 'cherry' means in git-cherry?

753 views Asked by At

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.

1

There are 1 answers

5
Shahbaz On BEST ANSWER

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).