git cherry-pick usage

Same branch pick

git cherry-pick +commit_id can pick the data of the commit id to the current

Operating procedures:

First of all:

A)git cherry-pick +制定commit_id
【注意】:
如果没有冲突的话,就pick到指定commit_id的commit数据

second:

B) 如果遇到冲突,cherry-pick失败,可以执行git diff查看冲突
   手动去解决冲突

third:

C) 冲突解决完成后,可以git status 查看有哪些数据发生变化,
   然后变化数据加入缓存(git add xxx)

At last:

D) 执行完上面操作后,如果冲突完全无误被解决的话,
   最后执行git cherry-pick --continue后将
   pick的commit信息打上

Cross branch pick

Cross branch:

For example, there is a master test branch, a test branch, if you want to pick a commit on the master branch, you need to perform the following operations

First: need to checkout to the test branch

git checkout -b test origin/test  

Refer to the above for other subsequent operations

Guess you like

Origin blog.csdn.net/weixin_43010385/article/details/113008541