1

The issue is Visual Studio Code does not recognise the ___ as they say "out of the box git" in their editor...

So I have installed Git five times, reinstalled Visual Studio Code five times, restarted the computer every time plus checked all the environment variables and have been googling the problem for two days...

Nothing is solving this problem other than a fresh install of Windows on the computer. I don’t have any clue where to turn to next...

Images of the issue...

First

Second

Third

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Tom Curphey
  • 17
  • 1
  • 3
  • The entry in your settings file has a green line under it, what message does it give? – fanduin Jun 01 '18 at 09:08
  • Thanks so much for getting back to me! It says: "Unknown configuration setting.." – Tom Curphey Jun 01 '18 at 11:44
  • 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:58
  • Please review *[Why not upload images of code/errors when asking a question?](https://meta.stackoverflow.com/questions/285551/)* (e.g., *"Images should only be used to illustrate problems that* ***can't be made clear in any other way,*** *such as to provide screenshots of a user interface."*) and [provide some text](https://stackoverflow.com/posts/50639459/edit). Thanks in advance. – Peter Mortensen Dec 28 '22 at 18:32

2 Answers2

1

Check your System variables environment variables and make sure that you have your Git path (C:\Program Files\Git\bin) added in the path environment variable.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Apokochito
  • 11
  • 2
  • Thank. It worked for me. I added git path (C:\Program Files\Git\bin) into System Environment and restart Vscode. I don't understand why I am using it normally then I have this problem. – Nam Lee Mar 14 '22 at 08:51
  • There is also *[What is the difference between user variables and system variables?](https://stackoverflow.com/questions/4477660/what-is-the-difference-between-user-variables-and-system-variables)*. – Peter Mortensen Dec 28 '22 at 18:43
0

I believe the issue is that you are setting the git.path setting in your workspace settings as opposed to your user settings.

As detailed in the Visual Studio Code documentation, for security reasons a number of settings that relate to external executables such as Git must be placed in user settings (otherwise you could, for example, clone a project that specifies a malicious executable instead of the actual Git executable in the project's workspace settings, thus causing you trouble).

If that Git path is indeed correct, then moving the setting to the user settings should resolve the issue.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
fanduin
  • 1,149
  • 10
  • 17
  • Thanks for the reply! The same issue is in user settings.. The problem is that git is not recognised in VS code – Tom Curphey Jun 01 '18 at 13:25
  • Positive that is the git path C:\Program Files\Git\cmd\git.exe C:\Program Files\Git\bin\git.exe But just to make sure I have tested both ways multiple time.. The concern is that VS code does not recognise git.. As you can see in the other 2 images above Thanks for the tip I wish this error was that simple though – Tom Curphey Jun 01 '18 at 14:00
  • Curious... Where did you install git from? Also, should have asked before, but can you use git on the command line? – fanduin Jun 01 '18 at 14:12
  • I installed it from the same site that vs code says they get their git from https://git-scm.com/ Yes git works in all terminals =) – Tom Curphey Jun 01 '18 at 14:16
  • A bit of a shot in the dark but some comments on github issues have suggested that writing the path in unix style (forward slashes instead of backwards ones) works for some people – fanduin Jun 01 '18 at 14:33
  • That might work once git is recognised by vs code. Thanks for the help though I really appreciate it – Tom Curphey Jun 01 '18 at 22:28