1

Error when trying a Git command in cmd:

The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I need this to work in the integrated terminal on Visual Studio Code!

I've already tried editing the path variables and the settings in Visual Studio Code. Nothing works.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • Possible duplicate of [Visual Studio Code does not recognize git](https://stackoverflow.com/questions/47849984/visual-studio-code-does-not-recognize-git) – EncryptedWatermelon Oct 01 '19 at 17:34
  • I already tried the solutions in that question. It doesn't work. I think I'm having a different problem! I'm not getting that error. I'm getting a different. It's not saying that git isn't installed, it's saying that 'git' is not _recognized_. – Gooey Developer Oct 01 '19 at 18:01
  • Likely canonical (2015, 36 answers, and 221 votes): *[Visual Studio Code cannot detect installed Git](https://stackoverflow.com/q/29971624/)*. – Peter Mortensen Dec 17 '22 at 01:57

1 Answers1

5

"Not recognized" is normally the way terminals politely tell you they don't know what you typed means.

If you can use Git from a command line, then it's installed properly. You can use where git or which git depending on your command line to find the path of the functioning Git (if those don't work, please specify your terminal type in the question).

Once done, open Visual Studio Code, hit Ctrl + , to open settings and type git path in the search. Add this path, and you should be able to use Git in Visual Studio Code.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
John Pavek
  • 2,595
  • 3
  • 15
  • 33
  • 2
    It also helps to try restarting VS Code after updating settings. – Gino Mempin Apr 06 '21 at 00:23
  • Please note: 1. That's a comma, not a full stop in the shortcut to open settings "CTRL + ," 2. You may need to replace the backslashes with forward slashes or escape the backslashes with another backslash. 3. If you have multiple VS Code windows, close all of them and then re-open for the changes to be made, reload a single VS Code window will not work if you have multiple. – Tigerrrrr Apr 24 '23 at 20:59