Is there a “theirs” version of “git merge -s ours”?

前端 未结 18 1768
傲寒
傲寒 2020-11-22 06:42

When merging topic branch \"B\" into \"A\" using git merge, I get some conflicts. I know all the conflicts can be solved using the version in \"B\".

I a

18条回答
  •  温柔的废话
    2020-11-22 06:46

    This will merge your newBranch in existing baseBranch

    git checkout  // this will checkout baseBranch
    git merge -s ours  // this will simple merge newBranch in baseBranch
    git rm -rf . // this will remove all non references files from baseBranch (deleted in newBranch)
    git checkout newBranch -- . //this will replace all conflicted files in baseBranch
    

提交回复
热议问题