0

I want to use Beyond compare 4 in order to perform merge and diff for my git repositories in Windows. I've set the following .gitconfig but when I execute git diff in the shell I obtain the textual diff inside the console instead that opening BC4.

What I'm doing wrong?

This is my .gitconfig:

[merge]
    tool = BeyondCompare4
[diff]
    guitool = BeyondCompare4
    tool = BeyondCompare4
[core]
    editor = \"C:/Program Files (x86)/Vim/vim74/gvim.exe\"
    autocrlf = True
[user]
    name = My name
    email = my@mail
[difftool "BeyondCompare4"]
    cmd = \"C:/Program Files (x86)/Beyond Compare 4/Bcomp.exe\" \"$LOCAL\" \"$REMOTE\"
[mergetool "BeyondCompare4"]
    cmd = \"C:/Program Files (x86)/Beyond Compare 4/Bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
    trustExitCode = true
[push]
    default = simple
[alias]
    lg = log --pretty=format:'%C(yellow)%h%Cred%d%Creset - %C(cyan)%an %Creset: %s %Cgreen(%cr)' --decorate --graph --all --abbrev-commit
    lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
    lastcommit = log --name-status HEAD^..HEAD
    lastdiff = diff HEAD^..HEAD
[filter "lfs"]
    clean = git-lfs clean %f
    smudge = git-lfs smudge %f
    required = true
Jepessen
  • 9,377
  • 11
  • 64
  • 111

2 Answers2

2

Here is how I set my .gitconfig file. See how Beyond and Compare does not need params.

[diff]
    tool = bc
    mnemonicprefix = true
[difftool]
    prompt = false
[difftool "bc"]
    path = C:\\Program Files\\Beyond Compare 4\\bcomp.exe
    trustexistcode = true
[merge]
    tool = bc
[mergetool]
    prompt = false
[mergetool "bc"]
    path = C:\\Program Files\\Beyond Compare 4\\bcomp.exe
    keepbackup = false
    trustexistcode = true
Sbu
  • 809
  • 10
  • 22
1

To launch a diff in an external tool, run git difftool.

For merges, run git mergetool.

Chris Kennedy
  • 2,101
  • 9
  • 8