git合并某次提交到某个分支

有的时候,在develop分支开发,是大家公用的开发分支,但是只想合并自己提交的到master,如何操作呢?那就要用cherry-pick了。

语法 git  cherry-pick commitid

首先,git log查看自己提交的log,找到版本号,如最近的版本号是 ee3c72

然后,切换到想要合并的分支,如想把develop的合并到master,切换到master,执行 git  cherry-pick ee3c72,执行完之后,提交就会在master上体现了,然后push,就可以了。

猜你喜欢

转载自www.cnblogs.com/kumufengchun/p/10218575.html