gerrit - git (pull vs checkout vs cherrypick) which is for what?

后端 未结 3 1625
Happy的楠姐
Happy的楠姐 2021-01-30 10:16

In Android\'s gerrit ex: link, to download the patch, I see 4 options.

  1. repo download
  2. checkout
  3. pull
  4. cherry-pick

What is th

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-30 11:16

    checkout: you want to use it when you are depending on a particular CHANGE in a branch. say your colleague has checked in some APIs for you to consume, and you can checkout that CHANGE to a new local branch and start working on your change.

    Cherrypick: you want to apply a particular CHANGE to your local branch or a particular release branch, then you cherrypick. Imagine you have a patch fix in your 1.1 release, and you want to apply that fix/CHANGE to your 2.0 branch, you can simply cherrypick it. It will create a new CHANGE in your 2.0 branch containing the fix.

    here is a graphical representation: http://think-like-a-git.net/sections/rebase-from-the-ground-up/cherry-picking-explained.html

提交回复
热议问题