Visual Studio Code cannot detect installed git
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}
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.
Update 2020 (Mac)
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.
Symptoms:
- You've been using
VS Code
for some time and have no issues withGit
- You install
XCode
(for whatever reason - OS update, etc) - After installing
XCode
,VS Code
suddenly "can't find Git and asks you to either install or set the Path in settings"
Quick fix:
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 :)