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