git:patch does not apply


转载来自:https://blog.csdn.net/qq_34602140/article/details/85060720

使用git时,如果想把一个项目的修改添加到另一个项目中时,可以使用git format-patch命令,把补丁包放到一个目录下面,在项目中使用git am命令即可。在使用git am时有时会报patch does not apply

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".

这些错误,说明当前patch有冲突,不能合并,此时使用git apply --reject patch文件,强制把不冲突的文件先合并,有冲突的会生成.rej文件 ,在根据这个文件中的修改去手动执行即可 ,解决完冲突要把.rej文件删除,在执行git add . ==> git am --continue命令即可。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM