應用patch時,最好不要使用master分支,用其他同步的分支處理后再merge到master中,確保安全。
1.$ git am 0001-XXX.patch
(錯誤信息如下)
...
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
2.
$
git apply --reject 0001-XXX.patch
先合並沒有產生沖突的文件,根據同目錄下的*.rej文件找出沖突地方
3.
$
git add ***
把本次patch改動的文件添加進入緩存
4.
$ git am --resolved
接受修改,出現問題時使用reset恢復