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

前端 未结 18 1547
傲寒
傲寒 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 07:00

    Older versions of git allowed you to use the "theirs" merge strategy:

    git pull --strategy=theirs remote_branch
    

    But this has since been removed, as explained in this message by Junio Hamano (the Git maintainer). As noted in the link, instead you would do this:

    git fetch origin
    git reset --hard origin
    

    Beware, though, that this is different than an actual merge. Your solution is probably the option you're really looking for.

提交回复
热议问题