Git Rebase / Merge Conflict 解决

  • Post author:
  • Post category:其他




git merge



$ git checkout master
$ git merge feature

Auto-merging Document
CONFLICT (content): Merge conflict in codefile.js
Automatic merge failed; fix conflicts and then commit the result.

如果我们要保留 Master

git checkout --ours codefile.js 

保留 Feature

git checkout --theirs codefile.js 

接下来

$ git add codefile.js
$ git merge --continue

[master 5d01884] Merge branch 'feature'



git rebase

git rebase 类似 ,将merge 改rebase 即可

最后一步

 $ git add codefile.js
$ git rebase --continue

Applying: a commit done in branch feature 



版权声明:本文为szgks原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。