首页 > 其他 > 详细

[Git] Cherry pick

时间:2019-01-23 16:38:28      阅读:183      评论:0      收藏:0      [点我收藏+]

For example we have:

  • develop branch
  • hotfix branch
  • release branch

‘develop‘ branch has all the latest commits and features; ‘release‘ branch is far behand ‘develop‘ branch.

Now we found a bug which is important to fix it now in our production.

‘hotfix‘ based on ‘develop‘ branch, contains all new features so we cannot just merge ‘hotfix‘ branch into ‘release‘ branch, otherwise, some new & untested features lack into production.

 

What we can do is using ‘cherry-pick‘:

1. we can find all the commit id which releated to ‘hotfix‘技术分享图片

技术分享图片

Then apply cherry-pick to our release branch:

git checkout release
git cherry-pick <commit-id>

 

It ensures we only get the changes we did for hotfix, not anything else we didn‘t touch.

[Git] Cherry pick

原文:https://www.cnblogs.com/Answer1215/p/10309383.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!