git cherry-pick 可以把某个分支的某几次提交合入到当前分支,只是在一台设备上操作。
git format-patch 可以把某个分支的n次提交分别打成n个补丁,然后把这些补丁文件(比如0001-.patch)发给其他人,或者发到其他机器,他们在自己的机器上,把这些补丁合入到他们当前的代码中。
比如,分支erebus20180910相比master分支,多了一次提交,打补丁就生成一个补丁文件
参考:https://www.jianshu.com/p/814fb6606734
git format-patch <r1>..<r2>
如:
git format-patch d77aaac74845435744c49ae65511d9e1be79ed5c...046ee8f8423302f5070ca81b4e246516e919cd7a -o patch
git format-patch -1 <r1>
git format-patch <r1>
git apply --stat 0001-minor-fix.patch
git apply --check 0001-minor-fix.patch
git am -s < 0001-minor-fix.patch
原文:https://www.cnblogs.com/shengulong/p/9623558.html