美文网首页Git
git cherry-pick 提交代码到其它分支

git cherry-pick 提交代码到其它分支

作者: 詹徐照 | 来源:发表于2017-08-29 15:57 被阅读18次

提出背景:在某个分支修改了某个bug,需要提交到另一个分支

假如我们有两个分支:master and b1
master上我们做了2次提交
git commit -m "commit 01" commit id: c64734e
git commit -m "commit 02" commit id: e86259e
当我们想把commit 01提交到b1时,可以执行下面命令:
git checkout b1
git cherry-pick c64734e

参考链接:
Push a commit in two branches with Git

相关文章

网友评论

    本文标题:git cherry-pick 提交代码到其它分支

    本文链接:https://www.haomeiwen.com/subject/lpnodxtx.html