git 补丁git formatpatch

转帖:http://yuxu9710108.blog.163.com/blog/static/237515342010111452438837/

git format-patch经验
A
git log
commit c
commit b
commit a
commit init


B
git log
commit init

=============
A,B两人代码共有commit init
现在A改动到a=>b=>c

B想用补丁来升级


A:
git format-patch init..c  ==>产生三个补丁
001-commit-a.patch 对应从commit init出发升到a
002-commit-b.patch 对应从commit a出发升到b
003-commit-c.patch 对应从commit b出发升到c

即git format-patch x..y
是从共有的x出发一路一个一个升到y
(x,y]

=================
B
git am *.patch git会自动按文件名一级级升上去的

或者使用git apply *.patch

原文地址:https://www.cnblogs.com/mliudong/p/3079889.html