Git source control not detected in multi-root .code-workspace

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In a multi-root workspace (opened via a .code-workspace file), the Git extension’s initial repository scan completes in ~1ms and finds 0 repositories, even though each workspace folder is a valid Git repo with a .git directory. The Source Control panel shows “No source control providers registered.” This does not happen in single-folder workspaces — only multi-root .code-workspace setups are affected.

The Git extension log confirms the issue:

[Model][doInitialScan] Initial repository scan started
[Model][doInitialScan] Initial repository scan completed - repositories (0), closed repositories (0), parent repositories (0), unsafe repositories (0)
The scan appears to receive an empty workspace folders list, completing instantly without checking the filesystem.

The workspace state DB still retains the correct repos from previous sessions (scm:view:visibleRepositories has all 4 repos), confirming this previously worked.

Workaround:

Adding explicit git.scanRepositories to the workspace file settings bypasses the broken auto-detection:

{
  "settings": {
    "git.scanRepositories": ["repo-a", "repo-b"]
  }
}

Steps to Reproduce

  1. Create a .code-workspace file with multiple folders, each being a separate Git repo:
{
  "folders": [
    { "path": "repo-a" },
    { "path": "repo-b" }
  ]
}
  1. Open the workspace file in Cursor via File > Open Workspace from File
  2. Check the Source Control panel, shows “No source control providers registered”
  3. Verify repos work fine from the terminal (git status succeeds in each folder)

Expected Behavior

The Git extension should detect and register all Git repositories defined in the .code-workspace folders, just as it does for single-folder workspaces.

Operating System

MacOS

Version Information

Version: 3.1.15
VSCode Version: 1.105.1
Commit: 3a67af7b780e0bfc8d32aefa96b8ff1cb8817f80
Date: 2026-04-15T01:46:06.515Z
Layout: glass
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

Does this stop you from using Cursor

Yes - Cursor is unusable

I’ve been using the workspace for many months. Today in the middle of regular use, the source control panel stuck in a state of permanently loading. I was not currently using the panel, but I had the old IDE open and was working in the new Agents window. The issue seems to have occurred in the background. The issue was not seen in any of my other projects, which are all single-repo.

Hey, thanks for the detailed report with logs and repro steps.

This is a known issue with multi-root workspaces. The Git extension sometimes gets an empty list of workspace folders during the initial scan due to a race condition on activation. Your workaround using git.scanRepositories is the right approach.

Another option that has helped other users is to set:

"git.autoRepositoryDetection": true

In Cursor, this defaults to "openEditors" unlike VS Code where it’s true, so the scan can skip repos if there are no files open from them. More details here: Can only access main folder in source control

After changing the setting, you need a full restart using Cmd+Q, then open Cursor again.

If the issue comes back after restart, you can try resetting the cached SCM state in state.vscdb. Details are here: Cursor not recognizing all of git repos within workspace

The team is aware of this issue and it’s showing up for multiple users. Your report helps us prioritize it. Let me know if the setting fixed it.