tell git to use ours merge strategy on specific files

前端 未结 2 1988
无人及你
无人及你 2020-11-29 00:43

I have the following directory structure:

/.git
/.git/info/attributes
/MyProject
/MyProject/pom.xml
/MyProject/MyCode.java

I have branch ma

2条回答
  •  醉话见心
    2020-11-29 01:23

    $ git config merge.ours.driver true
    

    or even

    $ git config --global merge.ours.driver true
    

    'ours' isn't one of the built-in merge drivers even though it's perfectly clear to you and me what it should do, and it seems git doesn't error out when a custom merge driver is undefined.

    (true above is just the unix true command, its success says it made the local version look right, in this case by doing nothing to it.)

提交回复
热议问题