https://blog.csdn.net/liuhaomatou/article/details/54410361
https://www.jianshu.com/p/e5d801b936b6
1. patch
git format-patch --commit
git format-patche 795fefabc
2. appy
先檢查patch文件:git apply --stat newpatch.patch
檢查能否應用成功:git apply --check newpatch.patch
打補丁:git am --signoff < newpatch.patch (使用-s或--signoff選項,可以commit信息中加入Signed-off-by信息)
git apply --reject --ignore-whitespace ~/patch/patch/test.diff 2>&1 | tee ~/patch/patch/testdiff.log``
gnore-whitespace是忽略多余的空格。
在使用git am之前, 你要首先git am --abort 一次,來放棄掉以前的am信息,這樣才可以進行一次全新的am。
3 沖突解決:
git apply --reject PATCH
$ edit edit edit
(譯注:根據.rej文件手動解決所有沖突)
找到文件改成 -
$ git add FIXED_FILES
$ git am --continue
