如何配置Visual Studio以使用Beyond Compare

我想配置Visual Studio默认状况下打开Beyond Compare做为diff工具。 我怎样才能作到这一点? php


#1楼

若是您使用的是TFS,则能够在Team Foundation中的diff / merge配置中找到更多信息- 常见的Command和Argument值 git

它显示了如何配置如下工具: 缓存

  • WinDiff的
  • DiffDoc(用于Word文件)
  • 的WinMerge
  • 超越比较
  • KDiff3
  • Araxis
  • 比较吧!
  • SourceGear DiffMerge
  • 超越比较3
  • 若是TortoiseMerge
  • Visual SlickEdit

#2楼

在Visual Studio 2008 +中,转到 app

Tools menu --> select Options

在此输入图像描述

在选项窗口 - >展开源代码管理 - >选择Subversion用户工具 - >选择超越比较 ide

而后单击肯定按钮.. 工具


#3楼

当一个新版本的Visual Studio出现,或者我移动PC,或者一个新成员加入团队时,我每6个月就会厌倦这样作。 那么,PowerShell: ui

# .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'}
}

适用于个人机器。 因人而异。 没有保证,也没有退款。 VS彷佛没有缓存密钥,所以当即生效。 this


#4楼

64位Windows 7上的VS2013须要如下设置:工具| 选项| 源控制| 爵士源控制 spa

检查复选框使用外部比较工具......(很容易错过) 操作系统

双向比较可执行文件的位置:C:\\ Program Files(x86)\\ Beyond Compare 3 \\ BCompare.exe

3路冲突比较可执行文件的位置:C:\\ Program Files(x86)\\ Beyond Compare 3 \\ BCompare.exe


#5楼

Visual Studio with Git for Windows

若是你使用GIT做为你的源代码管理系统而不是(至关过期的) TFVC,那么Visual Studio没有选项来配置这样的东西。
相反,它(在我看来正确)使用GIT配置文件的设置 。 所以,若是您已经使用GIT设置来使用Beyond Compare或任何其余第三方比较软件,它就会选择它并开始使用它。

若是没有,那么只需将其设置(请参阅此处以获取更多信息以及更新的帮助)。 使用Beyond Compare 4设置Visual Studio的相关信息是:

  1. 打开Visual Studio。
  2. 从工具菜单中选择选项。
  3. 在左侧树控件的Source Control分支下选择Plug-In Settings。
  4. 在右侧窗格的Plug-In Settings下选择Microsoft Git Provider。
  5. 编辑全局git配置文件(位置是Windows专用的操做系统,它是%HOMEDRIVE%%HOMEPATH%/.gitconfig 。请参阅此处获取信息)或者若是您但愿它是repo specifict,那么在Git存储库中启动项目后,编辑配置文件在项目文件夹中的.git文件夹中。
  6. 更改配置文件以反映如下更改:

    [diff] tool = bc4 [difftool "bc4"] cmd = \\"C:\\\\Program Files (x86)\\\\Beyond Compare 4\\\\BComp.exe\\" \\"$LOCAL\\" \\"$REMOTE\\" [merge] tool = bc4 [mergetool "bc4"] cmd = \\"C:\\\\Program Files (x86)\\\\Beyond Compare 4\\\\BComp.exe\\" \\"$REMOTE\\" \\"$LOCAL\\" \\"$BASE\\" \\"$MERGED\\"

若是使用64位安装程序,请验证可执行文件的名称。 我是BCompare.exe

[diff]
    tool = bc4
[difftool "bc4"]
    cmd = \"C:\\Program Files\\Beyond Compare 4\\BCompare.exe\" \"$LOCAL\" \"$REMOTE\"
[merge]
    tool = bc4
[mergetool "bc4"]
    cmd = \"C:\\Program Files\\Beyond Compare 4\\BCompare.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"

问题:若是您建立一个新的项目,并获得VS建立混账回购协议的同时, 覆盖的负载添加到.git/config文件,强制其使用Visual Studio再次(感谢您的MS!)。 在项目设置完成后经过其余方式建立git repo(如经过SourceTree或命令行等...)或编辑.git/config文件(在解决方案文件夹中)并删除上述设置的任何覆盖。
感谢minnow在评论中再次引发个人注意。

注意:我一直遇到这个,但我使用VS和GIT而且答案不正确,虽然有些评论提到了一个带正确答案的网址但不清楚,若是我一直不知道,我相信其余人会如此但愿这能解决这个问题。

相关文章
相关标签/搜索