Git 中的 cherry 为什么是这种意思?

2021-09-13 07:09:14 +08:00
 AndyAO

cherry 用于查找尚未应用于上游的提交,但其本身的意思是「樱桃」,为蔷薇科植物。

那么,这个 cherry 为什么会有这种意思呢?

去有道上查专业解释,也没看到与计算机有关的内容。

1734 次点击
所在节点    问与答
8 条回复
wd
2021-09-13 07:12:01 +08:00
你是指 cherry pick 吗?
chekun
2021-09-13 07:32:36 +08:00
cher·ry-pick
/ˈCHerēˌpik/
verb
verb: cherry-pick; 3rd person present: cherry-picks; past tense: cherry-picked; past participle: cherry-picked; gerund or present participle: cherry-picking; verb: cherrypick; 3rd person present: cherrypicks; past tense: cherrypicked; past participle: cherrypicked; gerund or present participle: cherrypicking
choose and take only (the most beneficial or profitable items, opportunities, etc.) from what is available.
"the company should buy the whole airline and not just cherry-pick its best assets"
AndyAO
2021-09-13 08:04:17 +08:00
@chekun #2 我说的是`git cherry`,不是`git cherry-pick`
heyjei
2021-09-13 08:06:44 +08:00
git cherrypick 指的是在一篮樱桃中挑选出又大又红的,放进另外一个篮子

git cherry 表示这个篮子比那个篮子多了哪些樱桃,确认下我挑选出来的樱桃,真的放进另外一个篮子了。
boboliu
2021-09-13 08:09:17 +08:00
cherry 在 git 里的词源就是 cherry-pick,后者是个习语
mcone
2021-09-13 09:45:55 +08:00
@AndyAO 你说的`git cherry`,就是从`git cherry-pick`派生(引申)出来的
> 我说的是`git cherry`,不是`git cherry-pick`
AndyAO
2021-09-13 10:29:39 +08:00
@heyjei #4 赞
AndyAO
2021-09-13 10:52:22 +08:00
感觉这是典型的 linux 式起名方法,很短但很不直观。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/801444

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX