Home > Net >  VSCode not using wsl2 git after moving installs
VSCode not using wsl2 git after moving installs

Time:01-13

I am running Ubuntu-20.0.4 and docker desktop in WSL2 on Windows 10 Pro. I recently moved the distributions onto another drive using export/import, keeping the same names by first unregistering the distributions. Everything works as expected, with the exception of git.

Git works fine using the integrated shell, but is prompting me to add global config when trying to commit via the ide. This leads me to believe that it is not using the remote git. How can I verify this, and are there any fixes?

CodePudding user response:

This leads me to believe that it is not using the remote git

Then you could open the VSCode settings, and put under Git Path the full path of the git you are expecting it to use.

That way, independently of the $PATH inherited by VSCode when running, said IDE would use the exact Git you need.


You also have to check with which account VSCode is running, or it would access the wrong "global" settings (IE the ones from another account).

The OP Romski adds in the comments:

I noticed that files created in VSCode were owned by root.
The fix was to set the default user <distribution> config --default-user <username>. I

  •  Tags:  
  • Related