0

I correctly installed GIT, but vs code command prompt responds:

"Git is not recognized as an internal or external command,operable program or batch file."

After adding:

"git.enabled": true,
"git.path": "C:\\'Program Files'\\Git\\mingw64\\bin\\git.exe",

it still won't work. Even after closing and opening vs code.

mklement0
  • 382,024
  • 64
  • 607
  • 775
  • 1
    Does this answer your question? [What is the reason for "X is not recognized as an internal or external command, operable program or batch file"?](https://stackoverflow.com/questions/41454769/what-is-the-reason-for-x-is-not-recognized-as-an-internal-or-external-command) Remove also both `'` in `git.path` string value. – Mofi Feb 03 '22 at 07:25

2 Answers2

0

Have you tried using escaped double-quotes in your .json file, instead of adding single-quotes, which do not exist within the path a all?

  "git.path": "\"C:\\Program Files\\Git\\mingw64\\bin\\git.exe\"",
Compo
  • 36,585
  • 5
  • 27
  • 39
  • or try adding `C:\Program Files\Git\mingw64\bin` to PATH in System Properties -> Advanced -> Environment Variables – Junior Mayhé Oct 28 '22 at 18:55
  • I would never advise that, @JuniorMayhé. There is no need ever to add any location to your one of your `Path` variables, and I do not advocate it. Also that would ne a GUI fix, and the question was clearly looking for a fix within their JSON. – Compo Oct 28 '22 at 19:02
-1

If vs code doesn't close your internal command prompt and reopens with it again, you have to close the cmd manually.

  • It sounds like you're saying that the change only takes effect in _future_ shells running in VS Code's integrate terminal, correct? – mklement0 Feb 03 '22 at 02:49
  • Also, it's not clear _what file_ you've added the lines in your question to. – mklement0 Feb 03 '22 at 03:08