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:

bash
Source Control panel is empty despite being in a git repository
Running 'git status' in the terminal works fine

This 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.path setting 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.autorefresh is disabled
  • Workspace trust not granted, blocking Git extension activation

Step-by-Step Fix

  1. 1.Verify VS Code can find git:
  2. 2.- Press Ctrl+Shift+P
  3. 3.- Type "Git: Show Git Output"
  4. 4.- Check the output panel for errors about git not being found
  5. 5.Set the correct git path. In .vscode/settings.json or user settings:
  6. 6.```json
  7. 7.{
  8. 8."git.path": "/usr/bin/git"
  9. 9.}
  10. 10.`
  11. 11.Find your git path:
  12. 12.```bash
  13. 13.which git
  14. 14.# On Windows: where git
  15. 15.`
  16. 16.Open the correct folder as the workspace root:
  17. 17.- File > Open Folder
  18. 18.- Select the directory that contains the .git folder (not a subdirectory)
  19. 19.Enable auto-refresh:
  20. 20.```json
  21. 21.{
  22. 22."git.autorefresh": true,
  23. 23."git.autofetch": true
  24. 24.}
  25. 25.`
  26. 26.Check workspace trust:
  27. 27.- If VS Code shows "Restricted Mode", click "Manage" > "Trust"
  28. 28.- Trust the workspace folder to enable Git extension features
  29. 29.Reload the Git extension:
  30. 30.- Press Ctrl+Shift+P
  31. 31.- Type "Developer: Reload Window"
  32. 32.- Or reinstall the Git extension (built-in): disable and re-enable it
  33. 33.For nested repositories, add them as workspace folders:
  34. 34.- File > Add Folder to Workspace
  35. 35.- Select the subdirectory containing the nested .git folder

Prevention

  • Keep VS Code updated to get the latest Git extension improvements
  • Verify git.path after 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.autorefresh enabled 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: true explicitly in workspace settings if Git is disabled by default