diff3
diff3
是非默认选项)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".
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 在 merge.conflictStyle
中称为 diff2
的双向冲突标记无关。diff3
与 git 称为 diff3
的三向冲突标记无关。我在配置文档中找到了答案:
git默认是diff2
merge.conflictStyle
指定合并时冲突块写入工作树文件的样式。
默认值为“merge”,它显示一个<<<<<<<冲突标记,
一方所做的更改,一个=======标记,
另一方所做的更改,
然后是一个>>>>>>>标记。另一种样式“diff3”添加了一个|||||||标记和=======标记之前的原始文本。
diff3
的替代选择,但它被称为“合并(merge)”,而不是“diff2”。 - Edward Thomson