Introduction
VS Code's built-in Git integration should automatically detect Git repositories in opened folders. When it fails, the Source Control panel shows "No source control providers registered" or the repository changes do not appear:
Source Control panel is empty despite being in a git repository
Running 'git status' in the terminal works fineThis disconnect between the terminal's git and VS Code's Git extension is frustrating and blocks core development workflows.
Symptoms
- Source Control panel shows no changes or "No repository"
- Git commands work in the integrated terminal but not in VS Code's UI
- Repository detected but changes do not appear in the Source Control panel
- Git blame and status bar information missing
- Works from command line but not in VS Code
Common Causes
git.pathsetting points to a non-existent or incorrect git executable- Repository is in a subdirectory not opened as a workspace folder
- Git version is too old for VS Code's Git extension requirements
git.autorefreshis disabled- Workspace trust not granted, blocking Git extension activation
Step-by-Step Fix
- 1.Verify VS Code can find git:
- 2.- Press
Ctrl+Shift+P - 3.- Type "Git: Show Git Output"
- 4.- Check the output panel for errors about git not being found
- 5.Set the correct git path. In
.vscode/settings.jsonor user settings: - 6.```json
- 7.{
- 8."git.path": "/usr/bin/git"
- 9.}
- 10.
` - 11.Find your git path:
- 12.```bash
- 13.which git
- 14.# On Windows: where git
- 15.
` - 16.Open the correct folder as the workspace root:
- 17.- File > Open Folder
- 18.- Select the directory that contains the
.gitfolder (not a subdirectory) - 19.Enable auto-refresh:
- 20.```json
- 21.{
- 22."git.autorefresh": true,
- 23."git.autofetch": true
- 24.}
- 25.
` - 26.Check workspace trust:
- 27.- If VS Code shows "Restricted Mode", click "Manage" > "Trust"
- 28.- Trust the workspace folder to enable Git extension features
- 29.Reload the Git extension:
- 30.- Press
Ctrl+Shift+P - 31.- Type "Developer: Reload Window"
- 32.- Or reinstall the Git extension (built-in): disable and re-enable it
- 33.For nested repositories, add them as workspace folders:
- 34.- File > Add Folder to Workspace
- 35.- Select the subdirectory containing the nested
.gitfolder
Prevention
- Keep VS Code updated to get the latest Git extension improvements
- Verify
git.pathafter installing or updating git on your system - Open the repository root folder, not a subdirectory
- Use multi-root workspaces for projects with multiple repositories
- Keep
git.autorefreshenabled for real-time change detection - Test Git integration after VS Code updates as extension behavior may change
- Document the minimum git version required in your project's setup guide
- Use
git.enabled: trueexplicitly in workspace settings if Git is disabled by default