git 提供了兩種簡單的patch方案:
- git diff 生成的標準patch
- git format-patch 生成的 git 專用patch (推薦)
git format-patch 生成的 git 專用patch
- git format-patch 生成patch(基於commit記錄生成)
# 不包括第一次commit,將 xxx.patch 都存放在patch目錄
$ git format-patch <第一次commit值> -o patch
- git am 打入patch
$ git am patch/*.patch
參考網址: