git: 没有可用的合并工具

git: no mergetool available

我打算将 winmerge 与 GitHubDesktop 一起设置为我的合并工具。在我实施 https://gist.github.com/shawndumas/6158524, out of curiosity, I tried to run git mergetool -- tool-help. I get "The following tools are valid, but not currently available." Referring to the git documentation (https://www.git-scm.com/docs/git-mergetool) 之前,我了解到,在这一点上,合并后不会发生任何冲突解决。我说得对吗?

谢谢

您需要配置 git 以寻找合适的工具:

git config --global merge.tool winmerge

如果无法自动定位应用程序,您可能需要指定二进制文件的确切路径

git config --global mergetool.winmerge.path C:/Program\ Files/Winmerge/path/to/binary.exe

然后重试。

关于您的问题,我认为没有(正确)答案:

Referring to the git documentation (https://www.git-scm.com/docs/git-mergetool), I understand that, at this point, no conflict resolution will happen if any after the merge. Am I correct?

git 不会尝试使用 mergetools 自动解决冲突,这些工具只是手动解决(但使用 GUI)git 无法解决的冲突。

因此,即使您没有配置 winmerge,当您执行 git merge 时,git 也会尝试使用其内部冲突解决算法来解决冲突。 如果要合并的版本之间的差异在不同文件或同一文件的不同块中,git 解决它们,否则git 将冲突区域标记为<<< === >>>。

mergetool 只是为您提供了一种方法来告诉您如何解决这些剩余的冲突。