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恢复

 

posted on 2012-04-05 18:03  fergus.y.m  阅读(5914)  评论(0编辑  收藏  举报