git am patch失敗時的一種處理方法


應用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恢復

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM