有人知道git使用哪个不同版本吗?
例如,这篇文章详细解释了虚拟人的差分算法,但是实际使用的算法是什么?
对于一般知识,这里是diff2和diff3的规范。
我知道您可以将git配置为使用diff2或diff3
git config --global merge.conflictstyle diff3发布于 2015-12-23 11:43:56
我在配置文档上找到了答案
git默认值为diff2
merge.conflictStyle指定合并时将冲突块写入工作树文件的样式。 默认情况是“合并”,它显示了一个<<<<<<<冲突标记, 由一侧,=======标记所做的更改, 另一方的改变, 然后是一个>>>>>>>标记。另一种风格, "diff3",会在=======标记之前添加一个财政记录符号和原始文本。
发布于 2015-12-23 18:12:31
你似乎混淆了三种不同的东西
diff3由GNU衍射提供diff3是一个非默认选项)。Git支持4种不同的差分算法。
您可以通过命令行向git diff指定
--minimal
Spend extra time to make sure the smallest possible diff is produced.
--patience
Generate a diff using the "patience diff" algorithm.
--histogram
Generate a diff using the "histogram diff" algorithm.
--diff-algorithm={patience|minimal|histogram|myers}
Choose a diff algorithm. The variants are as follows:
default, myers
The basic greedy diff algorithm. Currently, this is the default.
minimal
Spend extra time to make sure the smallest possible diff is produced.
patience
Use "patience diff" algorithm when generating patches.
histogram
This algorithm extends the patience algorithm to "support low-occurrence common elements".或者通过git配置。
diff.algorithm
Choose a diff algorithm. The variants are as follows:
default, myers
The basic greedy diff algorithm. Currently, this is the default.
minimal
Spend extra time to make sure the smallest possible diff is produced.
patience
Use "patience diff" algorithm when generating patches.
histogram
This algorithm extends the patience algorithm to "support low-occurrence common elements".原始问题中的diff2 pdf链接是对myers算法的描述,似乎与merge.conflictStyle中的双向冲突标记git调用diff2无关。
类似地,unix工具diff3与3路冲突标记git调用diff3无关。
https://stackoverflow.com/questions/34434750
复制相似问题