1

It used to work but after changing my laptop, it is not recognized anymore. Any help is highly appreciated!

Here is what I tried using Git Bash (git version 2.16.2.windows.1):

$ git config --list --show-origin
...
file:"C:\\Git\\mingw64/etc/gitconfig"   difftool.kdiff3.cmd='C:/Program Files/KDiff3/kdiff3' $LOCAL $REMOTE
file:"C:\\Git\\mingw64/etc/gitconfig"   difftool.kdiff3.keepbackup=false
file:"C:\\Git\\mingw64/etc/gitconfig"   difftool.kdiff3.trustexitcode=false
file:"C:\\Git\\mingw64/etc/gitconfig"   merge.conflictstyle=diff3
...

I copied the old working config file. But then:

$ git difftool master devSQC

This message is displayed because 'diff.tool' is not configured.
See 'git difftool --tool-help' or 'git help config' for more details.
'git difftool' will now attempt to use one of the following tools:
kompare emerge vimdiff
...

$ git difftool --tool-help
'git difftool --tool=<tool>' may be set to one of the following:
                vimdiff
                vimdiff2
                vimdiff3

        user-defined:
                kdiff3.cmd 'C:/Program Files/KDiff3/kdiff3' $LOCAL $REMOTE

The following tools are valid, but not currently available:
                araxis
                bc
                bc3
                codecompare
                deltawalker
                diffmerge
                diffuse
                ecmerge
                emerge
                examdiff
                gvimdiff
                gvimdiff2
                gvimdiff3
                kdiff3
                kompare
                meld
                opendiff
                p4merge
                tkdiff
                winmerge
                xxdiff

Some of the tools listed above only work in a windowed
environment. If run in a terminal-only session, they will fail.

$ git difftool -t=kdiff3 master devSQC

Viewing (1/61): '.gitignore'
Launch '_kdiff3' [Y/n]? y
Unknown merge tool _kdiff3
fatal: external diff died, stopping at .gitignore
Christoph
  • 6,841
  • 4
  • 37
  • 89
  • `kdiff3` is lised as valid, but not available. Have you installed `kdiff3` on your new laptop ? – LeGEC Apr 23 '18 at 14:42
  • @LeGEC Yes, the exe is in `C:\Program Files\KDiff3\kdiff3.exe` I also tried to wrap the path (containing a whitespace) in another `"` but it also didn't help. – Christoph Apr 23 '18 at 14:43
  • Could it be `git difftool -t kdiff3 master devSQC` instead of `git difftool -t_kdiff3 master devSQC`? There is a `_` – Jesferman Apr 23 '18 at 14:43
  • @Jesferman There was a typo. I used `git difftool -t=kdiff3 master devSQC`. See my edit. But you are right! Your suggestion now works. If you like, you can post it as answer. Strange - why was that changed? ... – Christoph Apr 23 '18 at 14:49
  • Great! Maybe you were mixing the syntaxis of long options with short options? I explain it in the answer. – Jesferman Apr 23 '18 at 14:54

1 Answers1

3

You have to change this line:

git difftool -t=kdiff3 master devSQC

by either:

git difftool -t kdiff3 master devSQC

or:

git difftool --tool=kdiff3 master devSQC

Usually, short arguments like -t are followed by a space character. And long options like --tool are followed by a =. It is kind of a convention.

Christoph
  • 6,841
  • 4
  • 37
  • 89
Jesferman
  • 1,049
  • 7
  • 12
  • One question on the usage of the difftool. Does it work if I just give the file name as below: `git difftool Target/Examples/main.c` It opens beyond compare 4 but does not load the local and the remote files. It just opens an empty instance of BC4 – Harsha J K Nov 18 '22 at 11:06