使用Git时,在Visual Studio 2013中安装Beyond Compare 4

3
我正在尝试弄清楚如何配置BEYOND COMPARE 4以在Visual Studio 2013与GIT中使用。无论我如何配置,它都想要使用VS2013内部的diff/merge工具。
Beyond Compare安装目录
C:\Program Files (x86)\Beyond Compare 4

从 git bash 窗口

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\me>git --version
git version 1.8.3.msysgit.0

C:\Users\me>git config --list
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
rebase.autosquash=true
diff.tool=bc4
difftool.bc4.path=C:\Program Files (x86)\Beyond Compare 4\BComp.exe
merge.tool=bc4
mergetool.bc4.path=C:\Program Files (x86)\Beyond Compare 4\BComp.exe
core.editor="C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor
core.autocrlf=true
credential.helper=!\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/
git-credential-winstore.exe\"
user.name=me
user.email=me@email.com
gui.recentrepo=C:/DevSource/mercury

C:\Users\me>

全局git配置文件在GIT安装/ etc目录中。
[core]
    symlinks = false
    autocrlf = true
[color]
    diff = auto
    status = auto
    branch = auto
    interactive = true
[pack]
    packSizeLimit = 2g
[help]
    format = html
[http]
    sslCAinfo = /bin/curl-ca-bundle.crt
[sendemail]
    smtpserver = /bin/msmtp.exe

[rebase]
    autosquash = true
[diff]
    tool = bc4
[difftool "bc4"]
    path = C:\\Program Files (x86)\\Beyond Compare 4\\BComp.exe
[merge]
    tool = bc4
[mergetool "bc4"]
    path = C:\\Program Files (x86)\\Beyond Compare 4\\BComp.exe

我尝试将exe文件名更改为BCompare.exe而不是BComp.exe,但也没有起作用。希望能得到帮助!


当你运行 git mergetool 时,会得到什么? - mgarciaisaia
1个回答

5

实际上,我相信我在这篇文章Git Diff with Beyond Compare中找到了答案,目前看来它是有效的。Visual Studio环境会打开新的BC4.0 IDE,而不是内部工具。

[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\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
    trustExitCode = true

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接