How to configure Beyond compare with Git command line
Asked Answered
R

4

5

I have been trying to figure out how configure beyond compare to be used via command line when using Git on windows (cygwin). Based on beyond compare's documentation they ask you to just use "path" to the bcomp.exe installation and everything should work. But it does not automatically pick up the "Local", "Base" and "Remote" params. I am using Beyond compare 3.0 PRO.

Rosanarosane answered 17/7, 2014 at 16:15 Comment(0)
R
11

I figured out the answer with a little bit of tinkering around with the git config. Note: I edited the global git config in notepad and here's how my config looks after i was done. Hope this helps someone.

[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
 keepBackup = false
Rosanarosane answered 17/7, 2014 at 16:16 Comment(1)
Doesn't seem to be working for me. How can I test what is going wrong?Turley
N
2

Beyond compare version 3.

For Linux in terminal type following commands:

git config --global diff.tool bc3
git config --global difftool.prompt false
git config --global difftool.bc3 trustExitCode true

git config --global merge.tool bc3
git config --global mergetool.bc3 trustExitCode true

For windows type following (you need to tell git the path to bcomp.exe)

git config --global difftool.bc3.path "c:/program files (x86)/beyond compare 3/BCompare.exe"
git config --global mergetool.bc3.path "c:/program files (x86)/beyond compare 3/bcomp.exe"
Nesto answered 14/8, 2015 at 14:17 Comment(0)
S
1

To get Visual Studio to actually understand that a merge had taken place I had to put single quotes around the path like this. This is for Beyond Compare 4 Pro on Windows.

[diff]
    tool = bc
[difftool "bc"]
    cmd =  '"C:/Program Files/Beyond Compare 4/BComp.exe"' "$LOCAL" "$REMOTE"
[merge]
    tool = bc
[mergetool "bc"]
    cmd = '"C:/Program Files/Beyond Compare 4/BComp.exe"' "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
    trustExitCode = true
    keepBackup = false
Sashenka answered 11/7, 2016 at 23:56 Comment(0)
I
0

Just a follow up note: you can edit the config file directly from the command line with the following code. - It will launch you command lines default editor.

$ git config --global --edit

P.s. the tip above worked for me too. I'm using win7 enterprise.

Invite answered 28/5, 2015 at 15:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.