您似乎混淆了三件事
GNU diffutilsdiff3
提供的unix命令行工具
git提供的差异的输出格式(这diff3
是非默认选项)
git用于生成差异的算法
Git支持4种不同的diff算法。
您可以通过命令行指定 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
算法的描述,似乎与git调用diff2
中的2向冲突标记无关merge.conflictStyle
。
同样,unix工具diff3
与git调用3向冲突标记无关diff3
。
您似乎混淆了三件事
GNU diffutilsdiff3
提供的unix命令行工具
git提供的差异的输出格式(这diff3
是非默认选项)
git用于生成差异的算法
Git支持4种不同的diff算法。
您可以通过命令行指定 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
算法的描述,似乎与git调用diff2
中的2向冲突标记无关merge.conflictStyle
。
同样,unix工具diff3
与git调用3向冲突标记无关diff3
。