Vscode-gitlens: DiffDirectoryCommand: Error: No diff tool found

Created on 27 Feb 2019  路  10Comments  路  Source: eamodio/vscode-gitlens

Firstly, I know maybe I should run "git config" command to config the third part diff tool. But I don't and Gitlens works--show diff results side by side in vscode, until I run "GitLens: Direcotry Compare All Changes".

Obviously, GitLens or vscode knows there is a "diff tool" to show diff result without any configuration. But why GitLens's "Direcotry Compare Command" cannot just pick than one? why we must configure it manually?

Most helpful comment

I found the solution for this.
edit the file:

~/.gitconfig

add this:

[diff]
    tool = vscode
[difftool "vscode"]
    cmd = code --wait --diff $LOCAL $REMOTE

if you want, you can also add this to use VSCODE for merge !

[merge]
    tool = vscode
[mergetool "vscode"]
    cmd = code --wait $MERGED

Soo cool, I love it.
Cheers,

All 10 comments

VSCode doesn't provide a directory compare tool.

@eamodio THX! Now I know the reason.

So does there any fix to this? Maybe some plugin?

+1 !

+1

Hi there,

Any update on this?.
How we can configure a diff tool on VScode for the gitLens functionality ?

I found the solution for this.
edit the file:

~/.gitconfig

add this:

[diff]
    tool = vscode
[difftool "vscode"]
    cmd = code --wait --diff $LOCAL $REMOTE

if you want, you can also add this to use VSCODE for merge !

[merge]
    tool = vscode
[mergetool "vscode"]
    cmd = code --wait $MERGED

Soo cool, I love it.
Cheers,

If the above fixes the error, but nothing happens when trying to diff... check to see if you can run the command in your terminal

code --wait --diff $LOCAL $REMOTE

If not then diffing isn't happening because you need to get the code command installed:

In command palette, search/run:

Shell Command: Install 'code' command in PATH

Diffing should now work in VSCode, in addition to running the command in your terminal.

This does not work for me, vs code opens but it cannot load the workspaces left/right, error is "unable to resolve workspace folder"
image
image

Any ideas?

For who doesn't want to mess around with your default CLI diff tool, see this ticket:
https://github.com/eamodio/vscode-gitlens/issues/195

example:

[diff]
    guitool = vscode
[difftool "vscode"]
    cmd = code --wait --diff $LOCAL $REMOTE

instead of setting tool, we set guitool to vscode, this allows you to see the diff in CLI as you normally would, and still be able to use gitlen compare in vscode.

Was this page helpful?
0 / 5 - 0 ratings