Search code examples
gitvisual-studio-codeadministrator

How to detect git on VSCode without administrator right


When I try to start Visual Studio Code without administrator right, I get VSCode report like "It look like git is not installed on your system".

I installed git(2.23.0) from https://git-scm.com/

and

Visual Studio Code (1.39.2) from https://code.visualstudio.com/

When I start VSCode with administrator rights, git is correctly detected.

I've tried to add git path on Windows environment PATH + restart PC -> did not work.

I've tried to add git path on VSCode setting.json + restart like :

{
    // Is git enabled
    "git.enabled": true,

    // Path to the git executable
    "git.path": "C:\\path\\to\\git.exe"

    // other settings
} 

--> that also did not work.

If I use "Show Git Output", the report shows me the correct path, but doesn't detect the git installation.


Solution

  • Finally, I found a solution to solve my problem. When I install VS code by default,is going on "C:\users[user]\AppData\vscode". and git default installation folder is "C:\Program Files\Git\"

    When I try to call git function from vscode it come from my user directory and access to git is forbidden.

    SOLUTION : I install git on my user directory and now it's work.