1

I would like to ask your help to fix this error on my VS Code: "It looks like Git is not installed on your system."

  1. I reinstalled Git and VS Code as well on my computer.
  2. Checked, Git uses VS Code as default.
  3. Changed the setting.json on VS Code (File/Preference/Settings...) with the proper "git path" from Command. (where git)
  4. Also restarted the computer.

It looks like, that I am logged in to my GitHub on VS code, but when I want to clone a repo, I get again this message: "It looks like Git is not installed on your system."

Thank you in advance for your help and time!

Melinda
  • 11
  • 2

1 Answers1

0

with the proper "git path" from Command. (where git)

The usual trick is to put in that setting the full path, including git.exe itself.

That is:

 C:\Program Files\Git\bin\git.exe 

Not:

 C:\Program Files\Git\bin

And I prefer using VSCode in a session where the %PATH% references C:\Program Files\Git\bin: that alone should be enough (no need to use the setting)

I usually set:

set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%

Then I launch VSCode, without any Git issue

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks, @VonC, right, I managed to mess my setting.json, but from here I could repair it: https://github.com/microsoft/vscode-docs/blob/main/.vscode/settings.json – Melinda Mar 24 '21 at 13:55
  • @Melinda Well done. As long as your `%PATH%` references the parent folder of `git.exe`, VSCode should not have any issue finding `git`. – VonC Mar 24 '21 at 13:57
  • about the set, I am not 100% sure where to write. Is it in the Command after C:\Program Files\Git\bin> ? – Melinda Mar 24 '21 at 14:02
  • I would recommend instead to make them persistent by modifying your Windows User environment variables settings: https://www.tenforums.com/tutorials/121664-set-new-user-system-environment-variables-windows.html – VonC Mar 24 '21 at 14:06