Henry
Henry

Reputation: 1623

VSCode Source Control is not Working While VSCode Terminal Git Is

When I go to the source control icon on the left-hand side of VSCode it says: "A valid git installation was not detected, more details can be found in the git output...". This started happening when I got the new VSCode update. The git output is:

Looking for git in: /usr/bin
Git installation not found.

If I open up the terminal in VSCode and type git --version I get git version 2.23.0, no errors. I wonder why this is happening. Any help would be appreciated.

Upvotes: 2

Views: 2149

Answers (1)

The git command in the terminal of VS Code is a system environment variable. So, when you use git --version, you do not get any errors. For your issue, it could be that after the VSCode was updated, git's setting path no longer existed.

You should add the following in your setting.json

"git.path": "/usr/bin/git"

Your VSCode settings are conveniently stored in a JSON file called settings.json. To edit your settings in settings.json, start by opening the Command Palette with CMD/CTRL + SHIFT + P. Type Open Settings (JSON) to directly edit the settings JSON.

Upvotes: 5

Related Questions