Help us understand the problem. What is going on with this article?

VSCodeでの`GitLens: Open Changes (with difftool)`実行時のエラーへの対処

More than 1 year has passed since last update.

Issue

GitLens: Open Changes (with difftool) 実行時に以下のエラーが出て、diff画面が開けない。

Unable to open changes in diff tool. No Git diff tool is configured

0_Screen Shot 2019-03-24 at 10.24.24.png

View Git Docsのリンクは以下。
https://git-scm.com/docs/git-config#git-config-difftool

Soltuion

以下を ~/.gitconfig に追加

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

ref) https://code.visualstudio.com/docs/editor/versioncontrol#_vs-code-as-git-diff-tool

Result

GitLens: Open Changes (with difftool) を実行
1_Screen Shot 2019-03-24 at 10.21.21.png

↓ diff画面が正しく表示される
2_Screen Shot 2019-03-24 at 10.22.06.png

PS

git-difftool について以下が参考になった。

https://girigiribauer.com/archives/20161227/

[diff]
  tool = vimdiff
[difftool]
  prompt = false

これらの設定は git-diff 用ではなく git-difftool 用です。 それぞれお間違えなく。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away