"Resolve using theirs"在git中的默认行为是什么?

4
根据这个问题,我知道在使用their的变化处理矛盾时,可以保留所有没有引起任何冲突的变化。
我想知道的是,在使用SourceTree(或者任何Git工具甚至命令行)时,在选择使用theirs解决时,对于单个文件(甚至是整个合并),默认行为是什么?
  • 它是否只是用远程文件中的内容完全替换本地文件?
  • 是否保留所有的本地非冲突变化,并仅对所有冲突使用theirs
2个回答

4
它解决了非冲突的更改并优先使用theirs来处理有冲突的更改。(ours相反)。
来自man
ours
    >>> This option forces conflicting hunks to be auto-resolved cleanly by 
    >>> favoring our version. Changes from the other tree that do not 
    >>> conflict with our side are reflected to the merge result.

    This should not be confused with the ours merge strategy, which does 
    not even look at what the other tree contains at all. It discards 
    everything the other tree did, declaring our history contains all that
    happened in it.

theirs
    This is opposite of ours.

0

遗憾的是,如果一个文件发生冲突并且你选择使用"使用他们的版本解决",Git会用他们的版本替换整个本地文件,而不仅仅是冲突的行。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接