我想配置Visual Studio打开超越比较默认作为差异工具。我该怎么做呢?


当前回答

不能评论,因为我的声誉评分很低。

这是回溯机链接到弗雷斯基的链接

其他回答

在Visual Studio 2008 +中,转到

工具菜单——>选择选项

在选项窗口——>展开源控制——>选择颠覆用户 选择超越比较

单击“确定”按钮..

我使用VS 2017与Git托管的项目在visualstudio.com托管(msdn)

上面的链接为我工作与“GITHUB for WINDOWS”指令。

http://www.scootersoftware.com/support.php?zz=kb_vcs#githubwindows

配置文件位于“c:\users\username\”的位置。gitconfig”,我只是根据我的情况将BC4更改为BC3,并使用适当的路径:

C:/Program Files (x86)/Beyond Compare 3/bcomp.exe

如果您正在使用TFS,您可以在Team Foundation -通用命令和参数值中的diff/merge配置中找到更多信息

介绍如何配置以下工具:

WinDiff DiffDoc(适用于Word文件) WinMerge 无以伦比 KDiff3 Araxis 比较它! SourceGear DiffMerge 无与伦比3 TortoiseMerge 视觉SlickEdit

每隔6个月,每当Visual Studio的新版本出来,或者我移动电脑,或者有新成员加入团队时,我就会厌倦这样做。所以,PowerShell:

# .Synopsys
# Sets up Beyond Compare professional as Diff tool for all instances of Visual Studio on this PC
# If you don't use TFS, change the sccProvider as appropriate
[CmdLetBinding()]
param(
    $bcPath = 'C:\Program Files (x86)\Beyond Compare 3\BComp.exe',
    $sccProvider = 'TeamFoundation'
)

$ErrorActionPreference = 'stop';
$baseKey = 'REGISTRY::\HKCU\Software\Microsoft\VisualStudio\*'

function SetRegKeyProperties($keyPath, [hashtable]$keyProps){
    if(!(Test-Path $keyPath)){
        Write-Verbose "Creating $keyPath"
        # Force required here to recursively create registry path
        [void] (new-item $keyPath -Type:Directory -Force);
    }
    foreach($prop in $keyProps.GetEnumerator()){
        Set-ItemProperty -Path:$keyPath -Name:$prop.Key -Value:$prop.Value;
    }
}

$configBases = dir $baseKey | ? { $_.PSChildName -match '^\d+\.\d$' }
foreach($item in $configBases){
    Write-Host "Configuring $item"

    $diffToolsKey = Join-Path $item.PSPath "$sccProvider\SourceControl\DiffTools"
    SetRegKeyProperties (Join-path $diffToolsKey '.*\Compare') @{Command=$bcPath;Arguments='%1 %2 /title1=%6 /title2=%7'}
    SetRegKeyProperties (Join-path $diffToolsKey '.*\Merge') @{Command=$bcPath;Arguments='%1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9'}
}

在我的机器上工作。YMMV。不保修,不退款。VS似乎没有缓存键,所以会立即生效。

@schellack发布的答案对于大多数情况都是完美的,但我想要Beyond Compare来模拟Visual Studio在自己的合并窗口中使用的“2路合并与结果面板”视图。

这个配置隐藏了中间面板(在大多数情况下AFAIK没有使用)。

 %1 %2 "" %4 /title1=%6 /title2=%7 /title3="" /title4=%9

感谢摩根