The Frustrating Blank Sidebar
You open VS Code, hit Ctrl+Shift+G to check your changes, and... nothing. Instead of your staged files, you're greeted by a persistent notification:
Git not found. Install it or configure it using the 'git.path' setting.
This happens when the editor loses track of the Git executable. Whether you just wiped your hard drive, updated VS Code, or accidentally tweaked your environment variables, the fix usually takes less than two minutes.
Step 0: The 5-Second Diagnostic
First, let's see if the problem is system-wide or just inside VS Code. Open your terminal (PowerShell, CMD, or Terminal.app) and type:
git --version
- "Command not found": Git isn't on your computer yet. Head to Step 1.
- Git version 2.x.x: Git is fine. VS Code just doesn't know where it lives. Jump to Step 2 or 3.
Step 1: Get the Binaries (If Missing)
If the terminal check came up empty, you need to install the engine. VS Code is just the interface; it won't install Git for you.
- Windows: Grab the installer from git-scm.com. Choose "Git from the command line and also from 3rd-party software" during the setup wizard.
- macOS: Open a terminal and run
xcode-select --install. If you use Homebrew,brew install gitis even faster. - Linux: Use your package manager. On Ubuntu, run
sudo apt update && sudo apt install git.
Once finished, close and reopen VS Code. It scans your environment on boot, so a restart often clears the error immediately.
Step 2: Repair the Windows System PATH
Windows users often find that Git works in a separate terminal but fails inside the editor. This usually means the system's "search list" is missing the Git directory.
-
Hit the Windows Key and type "env". Select Edit the system environment variables.
-
Click the Environment Variables button at the bottom.
-
Look for Path under "System variables" and click Edit.
-
Ensure these two lines exist. If not, click New and add them:
C:\Program Files\Git\binC:\Program Files\Git\cmd
-
Click OK, save your changes, and restart your computer if a simple VS Code restart doesn't work.
Step 3: Point VS Code Directly to Git
If you don't want to mess with system settings—or if you're using a Portable version of Git—you can hardcode the path inside VS Code.
Find Your Executable
In your terminal, run the command to locate the actual file path:
- Windows:
where git(Look for the one ending in\bin\git.exe) - macOS/Linux:
which git
Copy that path. It usually looks like C:\Program Files\Git\bin\git.exe or /usr/bin/git.
Update Your Settings
- Open Settings in VS Code (
Ctrl + ,). - Search for git.path and click Edit in settings.json.
- Add the path. Windows Note: You must use double backslashes (
\\) to avoid JSON errors.
// Windows Configuration
"git.path": "C:\\Program Files\\Git\\bin\\git.exe"
// macOS/Linux Configuration
"git.path": "/usr/local/bin/git"
Save the file. Your Source Control tab should come to life instantly.
Expert Troubleshooting
The WSL Hurdle
If you are working inside a WSL (Windows Subsystem for Linux) window, VS Code ignores your Windows Git installation. It expects Git to be installed inside the Linux distro. Run sudo apt install git in your Ubuntu terminal to satisfy the extension.
Security and Permissions
Corporate laptops sometimes block "child processes." If the path is correct but the error persists, check your antivirus logs. Sometimes security software prevents VS Code from "spawning" the Git process, effectively blinding the editor to your repository.

