git 中 "Resolve using theirs" 的默认行为是什么
What is the default behaviour of "Resolve using theirs" in git
根据 this question,我知道可以保留所有未引起任何冲突的更改,同时对冲突的更改使用 their
更改。
我想知道的是,当使用 SourceTree(或者,如果相关,任何 git 工具甚至命令行)时,选择 Resolve using theirs
时的默认行为是什么单个文件(甚至完全合并)。
- 它只是用远程中的任何内容替换完整的本地文件吗?
- 它是否保留所有本地非冲突更改并且只使用
theirs
来处理所有冲突?
它解决了非冲突的更改,更喜欢 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.
遗憾的是,如果文件发生冲突并且您选择了 "resolve using theirs",Git 将用他们的文件替换完整的本地文件,而不仅仅是冲突行。
根据 this question,我知道可以保留所有未引起任何冲突的更改,同时对冲突的更改使用 their
更改。
我想知道的是,当使用 SourceTree(或者,如果相关,任何 git 工具甚至命令行)时,选择 Resolve using theirs
时的默认行为是什么单个文件(甚至完全合并)。
- 它只是用远程中的任何内容替换完整的本地文件吗?
- 它是否保留所有本地非冲突更改并且只使用
theirs
来处理所有冲突?
它解决了非冲突的更改,更喜欢 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.
遗憾的是,如果文件发生冲突并且您选择了 "resolve using theirs",Git 将用他们的文件替换完整的本地文件,而不仅仅是冲突行。