Visual Studio Code cannot detect installed git

后端 未结 21 2181
走了就别回头了
走了就别回头了 2020-11-30 21:54

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 clie

相关标签:
21条回答
  • 2020-11-30 22:54

    First check if Git* installed or not in your system

    by typing the command in cmd /command prompt (In windows)

    where git
    

    if you get an output like this

    λ where git
    C:\cmder\vendor\git-for-windows\cmd\git.exe
    

    Then Go to Settings > Preferences > Settings and put the bellow code** right part.

     {
        // If git enabled ?
        "git.enabled": true,
    
        // Path to the git executable
        "git.path": "C:\\cmder\\vendor\\git-for-windows\\cmd\\git.exe"
    }
    
    • If you don't have Git installed , Install git from here https://git-scm.com/

    ** Just add double slash (\\) just like the above code.

    0 讨论(0)
  • 2020-11-30 22:56

    I had this problem after upgrading to macOS Catalina.

    The issue is resolved as follows:

    1. Find git location from the terminal:

    whereis git 2. Add the location of git in settings file with your location:

    settings.json

    "git.path": "/usr/bin/git", Depending on your platform, the user settings file (settings.json) is located here:

    Windows %APPDATA%\Code\User\settings.json

    macOS $HOME/Library/Application Support/Code/User/settings.json

    Linux $HOME/.config/Code/User/settings.json

    0 讨论(0)
  • 2020-11-30 22:57

    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
    }
    
    0 讨论(0)
提交回复
热议问题