Vscode-gitlens: Making GitLens work with WSL Git/Remote-WSL extension

Created on 1 Jun 2020  路  3Comments  路  Source: eamodio/vscode-gitlens

I have git installed within ubuntu WSL 2 on windows 10 ver 2004. Normally when I open VSCode, the default git extension throws a not found error, and then I open a new remote-wsl window.

I recently installed gitlens to use the git line blame feature but while enabled it fails:

GitLens was unable to find Git. Please make sure Git is installed. Also ensure that Git is either in the PATH, or that 'git.path' is pointed to its installed location.

I dont want multiple installations of git, I want to use the WSL git found on my ubuntu instance everywhere.

How do I achieve that for GitLens ?

question

Most helpful comment

It works when you install extensions inside Remote VSCode
1) Open a new VSCode Remote-WSL window (by connecting to an existing WSL distro)
2) Go to extensions, Gitlens click Install, i.e. Install on WSL: Ubuntu button
3) Reload the VSCode Remote-WSL window
4) Optional: Disable Git in Local window

All 3 comments

+1

I've WSL 1, git is installed in WSL Ubuntu. I use git on WSL Ubuntu, code is on Windows filesystem referenced via /mnt within WSL. When I switched to VSCode Remote develoment on WSL GitLens lost inline hints.

It works when you install extensions inside Remote VSCode
1) Open a new VSCode Remote-WSL window (by connecting to an existing WSL distro)
2) Go to extensions, Gitlens click Install, i.e. Install on WSL: Ubuntu button
3) Reload the VSCode Remote-WSL window
4) Optional: Disable Git in Local window

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

isaacwashere picture isaacwashere  路  3Comments

derrickstolee picture derrickstolee  路  3Comments

obrejla picture obrejla  路  3Comments

roblourens picture roblourens  路  4Comments

DavidBabel picture DavidBabel  路  3Comments