V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
AndyAO
V2EX  ›  问与答

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

  •  1
     
  •   AndyAO · 2021-09-13 07:09:14 +08:00 · 1710 次点击
    这是一个创建于 949 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

    8 条回复    2021-09-13 10:52:22 +08:00
    wd
        1
    wd  
       2021-09-13 07:12:01 +08:00 via iPhone
    你是指 cherry pick 吗?
    chekun
        2
    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
        3
    AndyAO  
    OP
       2021-09-13 08:04:17 +08:00
    @chekun #2 我说的是`git cherry`,不是`git cherry-pick`
    heyjei
        4
    heyjei  
       2021-09-13 08:06:44 +08:00 via Android   ❤️ 4
    git cherrypick 指的是在一篮樱桃中挑选出又大又红的,放进另外一个篮子

    git cherry 表示这个篮子比那个篮子多了哪些樱桃,确认下我挑选出来的樱桃,真的放进另外一个篮子了。
    boboliu
        5
    boboliu  
       2021-09-13 08:09:17 +08:00 via Android
    cherry 在 git 里的词源就是 cherry-pick,后者是个习语
    mcone
        6
    mcone  
       2021-09-13 09:45:55 +08:00
    @AndyAO 你说的`git cherry`,就是从`git cherry-pick`派生(引申)出来的
    > 我说的是`git cherry`,不是`git cherry-pick`
    AndyAO
        7
    AndyAO  
    OP
       2021-09-13 10:29:39 +08:00
    @heyjei #4 赞
    AndyAO
        8
    AndyAO  
    OP
       2021-09-13 10:52:22 +08:00
    感觉这是典型的 linux 式起名方法,很短但很不直观。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2823 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:14 · PVG 21:14 · LAX 06:14 · JFK 09:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.