Setting up Beyond Compare in Visual Studio 2013 when using Git
Asked Answered
T

2

32

How to configure Visual Studio to use Beyond Compare has a great answer for how to configure Visual Studio to use Beyond Compare. However, the UI for these steps has changed in Visual Studio 2013. Part of this may be due to the fact that I'm using Git for my SCM, and VS 2013 now has native Git support.

Has anyone figured out how to configure VS 2013 to use Beyond Compare?

Tafoya answered 19/10, 2013 at 2:22 Comment(1)
I was searching for a solution for this as it applies to VisualSVN. I finally found that I could disable the internal diff/merge tools inside the VisualSVN options. Is there some kind of separate Git menu with its own options you can access?Chem
A
40

At least for VS 2012 you can actually just update from the command prompt as shown on the Scooter website. http://www.scootersoftware.com/support.php?zz=kb_vcs#gitwindows

If you've installed msysgitVS using the Configure User Tools thingy in VS, your path to Git will probably be:

C:\Program Files (x86)\Git\cmd\git.exe

For Git 1.7.6 and newer, edit the global config file to set the path. At a Windows command prompt enter the following commands:

For Beyond Compare v3 use:

git config --global diff.tool bc3

git config --global difftool.bc3.path "c:/program files (x86)/beyond compare 3/bcomp.exe"

If you've got PRO license, also these:

git config --global merge.tool bc3

git config --global mergetool.bc3.path "c:/program files (x86)/beyond compare 3/bcomp.exe"

Then when doing a comparison in Visual Studio it will use BeyondCompare.


For Beyond Compare v4 use:

git config --global diff.tool bc4

git config --global difftool.bc4.cmd "\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\""

and

git config --global merge.tool bc4

git config --global mergetool.bc4.cmd "\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""

git config --global mergetool.bc4.trustExitCode true

Agronomics answered 29/10, 2013 at 20:37 Comment(5)
This worked in VS2012 with the Microsoft Git provider beta but doesn't work in VS2013 RTM.Amandy
@BrianReiter: it should, it's the same code. If it doesn't, please file a Connect bug.Parasite
+1 works perfectly for diff & merge for VS2013 Update 1 using Git 1.8.4 tyvmHildahildagard
This doesn't affect existing repositories. To do that open Git Bash, changed directory (cd) to the repository, and perform the above commands without the "--global". I did this on VS2012 and it worked without having to restart Visual Studio.Azar
@Azar Your trick worked for me with an existing repo under VS2013. Thanks!Proven
A
0

I see your BeyondCompare integration and raise you automerge capabilities. Trust me if you are merging large amounts of files you will want the automerge option enabled :)

[diff]
        tool = bc3
[difftool]
        prompt = false
[difftool "bc3"]
        path = /c/Program Files (x86)/Beyond Compare 3/BComp.exe
[merge]
        tool = bc3
[mergetool]
        prompt = false
        keepBackup = false
[mergetool "bc3"]
        cmd = /c/Program Files (x86)/Beyond Compare 3/BComp.exe -automerge -ignoreunimportant -reviewconflicts "$LOCAL" "$REMOTE" "$BASE" "$MERGED" 
        trustExitCode = true
Acropetal answered 29/9, 2014 at 20:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.