11

I'm working with most recent Visual Studio 2012 Update 2 and I have installed official Microsoft's Git support. 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?

I've asked the same question in Q&A section in Visual Studio Tools for Git support forum, but no answer for now.

shytikov
  • 8,648
  • 7
  • 54
  • 101

4 Answers4

9

Restarting Visual Studio (2019) solved it.

Hakan Fıstık
  • 14,367
  • 10
  • 94
  • 117
6

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
  • 752
  • 8
  • 23
  • 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
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
  • 997
  • 1
  • 5
  • 14
0

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
  • 936
  • 15
  • 20