问题描述
我找到了,它解释了你可以让Visual Studio 2013在比较Git中的文件时使用内置的diff工具,但我遇到了相反的问题。现在,当我右键单击Git Commit Details
窗口中的文件并选择与以前比较...
VS在默认的Visual Studio 2013比较工具中执行diff,但我希望它使用外部diff工具,特别是TortoiseMerge.exe。我在C:\ Users \ [My Name] \.gitconfig中指定了它,它可以从GitBash控制台正常工作,但Visual Studio会忽略此设置并始终使用其内置工具。
这就是我在那个.gitconfig中的内容:
[merge]
tool = kdiff3
[mergetoolkdiff3]
path = c:/ Program Files(x86)/KDiff3/kdiff3.exe
[diff]
guitool = TortoiseMerge
[difftoolTortoiseMerge]
path = C:/ Program Files / TortoiseSVN / bin / TortoiseMerge.exe
我也检查了我的本地存储库的.gitconfig以确保它不覆盖此设置,并且它没有指定任何diff或difftool设置。
[diff]
guitool = TortoiseMerge $ b我的.gitconfig中也尝试过类似的设置。 $ b [difftoolTortoiseMerge]
cmd = \C:/ Program Files / TortoiseSVN / bin / TortoiseMerge.exe\/ base:$ REMOTE / local:$ MINE
但行为不会改变。
$ b $ Visual Studio使用 diff.tool
配置设置,而不是 diff .guitool
配置设置。 尝试:
[diff]
tool = TortoiseMerge
I've found this post that explains how you can have Visual Studio 2013 use the built-in diff tool when comparing files in Git, but I'm having the opposite problem. Right now when I right-click on a file in the Git Commit Details
window and choose Compare With Previous...
VS performs the diff in the default Visual Studio 2013 compare tool, but I want it to use an external diff tool, specifically TortoiseMerge.exe. I have it specified in my C:\Users\[My Name]\.gitconfig and it works properly from the GitBash console, but Visual Studio ignores this setting and always uses its built-in tool.
This is what I have in that .gitconfig:
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = c:/Program Files (x86)/KDiff3/kdiff3.exe
[diff]
guitool = TortoiseMerge
[difftool "TortoiseMerge"]
path = C:/Program Files/TortoiseSVN/bin/TortoiseMerge.exe
I have also checked my local repository's .gitconfig to make sure it wasn't overriding this setting, and it does not specify any diff or difftool settings.
I have also tried similar settings in my .gitconfig like:
[diff]
guitool = TortoiseMerge
[difftool "TortoiseMerge"]
cmd = \"C:/Program Files/TortoiseSVN/bin/TortoiseMerge.exe\" /base:"$REMOTE" /local:"$MINE"
but the behavior does not change.
Visual Studio uses the diff.tool
configuration setting, not the diff.guitool
configuration setting.
Try:
[diff]
tool = TortoiseMerge
这篇关于如何在Visual Studio 2013中为Git使用外部差异工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!