LoginSignup
4
4

More than 5 years have passed since last update.

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

Last updated at Posted at 2019-03-24

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 について以下が参考になった。

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

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

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4