Visual Studio Code cannot detect installed git

Visual Studio Code reports "It look like git is not installed on your system." when I try to switch to the git view. I know I have git installed and used by other git clients. I guess if I re-install git following Visual Studio Code's instruction ("install it with Chocolatey or download it from git-scm.com"), it probably can fix the problem, but I don't want to mess up the existing git clients on my system. Is there a reliable way to configure Visual Studio Code so it can find existing git installation?


Solution 1:

Now you can configure Visual Studio Code (version 0.10.2, check for older versions) to use existing git installation.

Just add the path to the git executable in your Visual Studio Code settings (File -> Preferences -> Settings) like this:

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

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

    // other settings
}

Solution 2:

Visual Studio Code simply looks in your PATH for git. Many UI clients ship with a "Portable Git" for simplicity, and do not add git to the path.

If you add your existing git client to your PATH (so that it can find git.exe), Visual Studio Code should enable Git source control management.