5

I just updated Visual Studio Code to v.1.19.0 and suddenly Git is not recognized. I can still perform everything from the terminal (cmd) window, but the Source Control tab is empty and I get:

Git not found. Install it or configure it using 'git.path' setting"

This is what I see in the Output console:

Looking for git in: C:\Users\UserName\AppData\Local\Programs\Git\cmd
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Program Files (x86)\Git\cmd\git.exe
Looking for git in: C:\Program Files\Git\cmd\git.exe

In my settings I have:

"git.path": "C:\\Users\\UserName\\AppData\\Local\\Programs\\Git\\cmd"

which points to the location of git.exe

I am not sure why, but when I installed Git it placed it in the AppData folder instead of in Program Files. Regardless, everything was working fine until this morning when I installed the update.

If it helps, I am on a Windows machine with Windows 10 64-bit OS and Git version 2.15.1.windows.2.

Why is Visual Studio Code not seeing it?

3
  • What is the location of git? maybe you just need \\ on the end of the path Commented Dec 16, 2017 at 21:17
  • You were on the right path, but this did not work. I had to add git.exe at the end of the path as VonC suggested below. Commented Dec 16, 2017 at 21:26
  • Likely canonical (2015, 36 answers, and 221 votes): Visual Studio Code cannot detect installed Git. Commented Dec 17, 2022 at 1:58

1 Answer 1

4

2017: Try setting git.exe instead of the parent folder:

"git.path": "C:\\Users\\UserName\\AppData\\Local\\Programs\\Git\\cmd\\git.exe"

This is what I needed in my own VSCode User settings:

user settings for git.exe


More recently, VSCode 1.50+ (Sept. 2020), I mention in "Visual Studio Code cannot detect installed Git" that you can add multiple paths.

That helps when your VSCode settings are synchronized across your machines, but your Git is installed in different places on said machines.

And don't forget, with VSCode 1.60+, "git.enabled": true.

Sign up to request clarification or add additional context in comments.

2 Comments

brilliant. it worked :) SO would not let me accept the answer yet, but I will in a few minutes. I wonder why this happened suddenly. I have the path in my environment variables. It seemed that it used the path from there up until now.
Did not work for me. I set the git.path setting, however, every time I start VS Code I still get "Git not found. Install it or configure it using the 'git.path' setting.". I'm on version 1.37 of VS Code.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.