Git

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

2017-08-29  本文已影响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

上一篇 下一篇

猜你喜欢

热点阅读