What does cherry-picking a commit with Git mean?

前端 未结 12 2300
梦毁少年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:14

    cherry-pick is a Git feature. If someone wants to Commit specific commits in one branch to a target branch, then cherry-pick is used.
    git cherry-pick steps are as below.

    1. checkout (switch to) target branch.
    2. git cherry-pick 
      

      Here commit id is activity id of another branch.Eg.

      git cherry-pick 9772dd546a3609b06f84b680340fb84c5463264f
      
    3. push to target branch

    Visit https://git-scm.com/docs/git-cherry-pick

提交回复
热议问题