What does cherry-picking a commit with Git mean?

前端 未结 12 2134
梦毁少年i
梦毁少年i 2020-11-22 11:58

Recently, I have been asked to cherry-pick a commit.

So what does cherry-picking a commit in git mean? How do you do it?

12条回答
  •  既然无缘
    2020-11-22 12:25

    If you want to merge without commit ids you can use this command

    git cherry-pick master~2 master~0
    

    The above command will merge last three commits of master from 1 to 3

    If you want to do this for single commit just remove last option

    git cherry-pick master~2
    

    This way you will merge 3rd commit from the end of master.

提交回复
热议问题