
但是作为代码开发者,这个并不重要,因为只关心代码有没有bug,需求有没有提交。
说到代码提交,有些git命令还真不能忽视,往往却有着大用途,比如git cherry-pick命令。
可以选择某一个分支中的一个或几个commit(s)来进行操作。下面具体演示操作流程。
首先是我有两个分支master和dev,master有两次提交记录。

dev分支是在第一次提交的时候切换出来的,而且没有第二次提交记录,第二次提交是在master上的,那么如何让master上的第二次提交转移到dev上呢?

通过git cherry-pick <commit id>
拉取其他分支提交记录,这样就防止了代码提交到了错误的分支。

但是原来的分支还有错误的提交记录,也就是master还有第二次的提交记录,此时你可以放心的把第二次提交给删除了。
