当前位置:  开发笔记 > 编程语言 > 正文

git版本的差异版本是什么?diff2或diff3?

如何解决《git版本的差异版本是什么?diff2或diff3?》经验,为你挑选了1个好方法。

您似乎混淆了三件事

    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



1> Andrew C..:

您似乎混淆了三件事

    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

推荐阅读
凹凸曼00威威_694
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有