Visual Studio Code cannot detect installed git

后端 未结 21 2183
走了就别回头了
走了就别回头了 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:50

    The only way I could get to work in my Windows 8.1 is the following: Add to system environment variables (not user variables):

    c:\Users\USERNAME\AppData\Local\GitHub\PortableGit_YOURVERSION\bin\;c:\Users\USERNAME\AppData\Local\GitHub\PortableGit_YOURVERSION\libexec\git-core\;c:\Users\USERNAME\AppData\Local\GitHub\PortableGit_YOURVERSION\cmd\

    This fixed the "it looks like git is not installed on your system" error on my Visual Studio Code.

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

    here's what worked for me, instead of using the visual code terminal to run your git commands, run the git commands from a cmd terminal at the path of your application

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

    For Linux based OS. I had such an issue due to a corrupted path but was able to temporarily fix the issue and my git was immediately restored.

    In case you're facing such path issue type the command below

    export PATH="/usr/bin:/bin:$PATH"
    
    0 讨论(0)
  • 2020-11-30 22:51

    i have recently start visual studio code and have this issue and just write the exact path of executable git solve the issue .... here is the code ...

    "git.path": "C:\Program Files\Git\bin\git.exe",

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

    In Visual Studio Code open 'user settings': ctrl + p and type >sett press enter

    This will open default settings on left side and User settings on right side.

    Just add path to git.exe in user settings

    "git.path": "C:\\Users\\[WINDOWS_USER]\\AppData\\Local\\Programs\\Git\\bin\\git.exe"
    

    Replace [WINDOWS_USER] with your user name.

    Restart Visual Studio Code

    0 讨论(0)
  • This can happen after upgrading macOS. Try running git from a terminal and see if the error message begins with:

    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) ...

    If so the fix is to run

    xcode-select --install

    from the terminal. see this answer for more details

    0 讨论(0)
提交回复
热议问题