14

I'm working with the most recent Visual Studio 2012 Update 2 and I have installed official Visual Studio Tools for Git. But when I try to diff modified file studio screams:

Failed to start the configured compare tool.

But it seems there is no configuration for compare tool in Git provider! What should I do to solve the issue?

Maybe I'm missing something?

Hakan Fıstık
  • 16,800
  • 14
  • 110
  • 131
shytikov
  • 9,155
  • 8
  • 56
  • 103

6 Answers6

13

Restarting Visual Studio (2019) solved it.

Hakan Fıstık
  • 16,800
  • 14
  • 110
  • 131
10

If anyone lands on this question for the same issue (like I did), VS 2015 has ability to configure under Git Settings.

enter image description here

WiSeeker
  • 812
  • 9
  • 24
  • This only displays the configuration, but does not let you edit it. You can change the settings by editing this file: C:\Users\username\.gitconfig – Bjarte Aune Olsen Dec 07 '16 at 12:07
  • 2
    This will in fact allow the settings to be changed and it does update the .gitconfig file but I still get the error even after restarting VS and even after a reboot. – HisDivineShadow Apr 10 '17 at 16:24
  • 1
    In my case I had to open Visual Studio as administrator, because the merge tool tried to create a temp directory in C – toscanelli May 27 '21 at 11:02
  • 1
    @Toscanelli, thanks, also had to run it as admin. – Carra Jun 22 '21 at 07:13
6

I noticed that when you restart your VS (1), if you try to see the changes on a file that you didn't open/load, diff tool gets confused. For me restarting is the problem

My solution: Just open/load that file in VS, then try again.

(1): I am using VS2022 but seem like it happens for all versions

boyukbas
  • 1,137
  • 16
  • 24
2

Make sure that you've set diff.tool for the git environment that visual studio uses. Normally you find this by starting Git bash from the start menu. If you use other git tools, you must set this for the global scope:

git config --global difftool.vs11.cmd "c:/program files (x86)/microsoft visual studio 11.0/common7/ide/devenv.exe" '//diff' "$LOCAL" "$REMOTE"

git config --global diff.tool vs11

Per-Frode Pedersen
  • 1,027
  • 1
  • 6
  • 15
0

Happened to me in VS2022 and the fix was also to restart, but not just the instance of VS where I was encountering the problem, I had to restart all running instances. Additional data points:

  • My global git compare tool was already properly configured
  • VS was running elevated
  • Within the instance exhibiting the problem, only some files would trigger it; others would compare fine. And other running instances of VS could also compare fine.
ALomaka
  • 42
  • 1
  • 2
0

I had exactly the same problem. In my specific case I use Beckhoff TwinCAT 3 (Visual Studio) and got the error message

"Quellcodeverwaltung - Git / Fehler beim Starten des konfigurierten Vergleichstools"

In English this means "Failed to start the configured compare tool."

I figured out that I get this message every time, when I try to compare a file which is already open in Visual Studio.

Solution: First close the file, after that do the compare of this file

Closing the project or restarting Visual Studio only helps if Visual studio is configured not to reopen the last opened session/files. That explains, why some people had success by Restarting Visual Studio and others not.

Michael Hutter
  • 1,064
  • 13
  • 33