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
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.
VSCode 1.50 (Sept 2020) adds an interesting alternative with issue 85734:
Support multiple values for the
git.path
settingI use VSCode in three different places; my home computer, my work computer, and as a portable version I carry on a drive when I need to use a machine that doesn't have it.
I use an extension to keep my settings synced up between editors, and the only issue I've encountered so far is that the git path doesn't match between any of them.
- On my home machine I have it installed to
C
of course,- work likes to be funny and install it on
A
,- and for the one on my drive I have a relative path set so that no matter what letter my drive gets, that VSCode can always find
git
.I already attempted to use an array myself just to see if it'd work:
"git.path": ["C:\\Program Files\\Git\\bin\\git.exe", "A:\\Git\\bin\\git.exe", "..\\..\\Git\\bin\\git.exe"],
But VSCode reads it as one entire value.
What I'd like is for it to recognize it as an array and then try each path in order until it finds Git or runs out of paths.
This is addressed with PR 85954 and commit c334da1.
Three years later, I ran into the same issue. Setting the path in user settings & PATH environment variable didn't help. I updated VSCode and that solved it.
open
C:\Users\nassim\AppData\Roaming\Code\User\settings.json
comment any git line there
// ...
// "git-graph.integratedTerminalShell": "E:\\Apps\\Git\\bin\\bash.exe",
// "git.path": ""
//...
and add git.exe to the OS path
Note for me fixing this git error also fixed the npm error too , since they are both defined in the path, if one fail , the remaining will fail as well
Went through this $h!†
again after updating to Catalina, which requires an XCode
update.
And to clarify, while this post is about VS Code
, this issue, is system wide. Your git
install is affected/hosed. You can try to run git
in your terminal/bash/zsh or whatever it is now and it just won't.
Same fix, just update XCode
, start it up and agree to license. That's it.
Old post, but just hit this on MAC/OSX
so hope this helps someone.
VS Code
for some time and have no issues with Git
XCode
(for whatever reason - OS update, etc)XCode
, VS Code
suddenly "can't find Git and asks you to either install or set the Path in settings"Run XCode
(for the first time, after installing) and agree to license. That's it.
How I stumbled upon this "fix":
After going through numerous tips about checking git
, e.g. which git
and git --version
, the latter actually offered clues with this Terminal message:
Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.
As to why XCode
would even wrap it's hands on git
, WAT
Happy holidays and happy coding :)
I had this problem after upgrading to macOS Catalina.
The issue is resolved as follows:
1. Find git location from the terminal:
which git
2. Add the location of git in settings file with your location:
settings.json
"git.path": "/usr/local/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