Cursor not recognizing all of git repos within workspace

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I open a workspace with multiple folders that each have a git repo. In the source control sidebar, I don’t see all the repos.

When I open the same workspace in VSCode, it recognizes all of them.

This happens occasionally when I move around folders, but restarting Cursor does not fix it.

Steps to Reproduce

I didn’t specifically create git repos to try and reproduce this, but here’s my guess about what might work:
create a workspace, add multiple folders that each have git repos
make some kind of change like deleting/moving then restoring a folder
see if all repos still show up in the source control sidebar

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.47 (Universal)
VSCode Version: 1.105.1
Commit: 2d3ce3499c15efd55b6b8538ea255eb7ba4266b0
Date: 2025-12-04T02:31:50.567Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Hey, thanks for the report. We need some details and a couple of checks:

What to share:

  • Screenshot of the Source Control panel in Cursor and in VS Code for the same workspace
  • Folder layout: where repos live, whether there are nested repos, submodules, worktrees, or symlinks
  • Whether you use a .code-workspace file or just open multiple folders
  • Output logs: open View > Output, pick the “Git” channel, copy logs right after opening the workspace

What to try:

  • Ensure the built-in Git extension is enabled: Extensions > @builtin Git
  • Settings: set git.enabled = true and git.autoRepositoryDetection = true or subfolders, then Reload Window
  • Remove and re-add the problematic folders to the workspace
  • Check for conflicting extensions: run from terminal with cursor --disable-extensions and check Source Control
  • If you have submodules or worktrees, specify which. For worktrees, you can show them in SCM via git.showCursorWorktrees

If you can attach a minimal folder structure where this reproduces, that’d be great. Let me know if any step helps.

Updated bug reports with version info:


Bug 1: Closed repositories cannot be re-opened

Environment:

  • Cursor: 2.2.36 (Universal)
  • VSCode Version: 1.105.1
  • Commit: 55c9bc11e99cedd1fb93fbb7996abf779c583150
  • OS: macOS arm64 (Darwin 25.1.0)

Summary:
When you “Close Repository” in Source Control, the repo is permanently hidden with no UI to restore it.

Root Cause:
Closed repos persist in SQLite at:

~/Library/Application Support/Cursor/User/workspaceStorage/<hash>/state.vscdb

Key: vscode.git{"closedRepositories":["/path/to/repo"]}

Reproduction:

mkdir ~/tmp/cursor-bug && cd ~/tmp/cursor-bug
git clone --depth 1 https://github.com/cli/cli.git repo-a
git clone --depth 1 https://github.com/junegunn/fzf.git repo-b
git clone --depth 1 https://github.com/sharkdp/bat.git repo-c

for r in repo-a repo-b repo-c; do
  cd ~/tmp/cursor-bug/$r && git worktree add "../${r}-wt/branch" -B branch
done

cat > ~/tmp/cursor-bug/test.code-workspace << 'EOF'
{"folders":[
  {"name":"cli","path":"repo-a-wt/branch"},
  {"name":"fzf","path":"repo-b-wt/branch"},
  {"name":"bat","path":"repo-c-wt/branch"}
],"settings":{"scm.alwaysShowRepositories":true}}
EOF
  1. Open workspace → 3 repos in Source Control ✓
  2. Right-click “fzf” → Close Repository
  3. Try to restore: Reload Window, edit workspace file, quit/reopen → repo stays hidden

Workaround:

sqlite3 "~/Library/Application Support/Cursor/User/workspaceStorage/<hash>/state.vscdb" \
  "UPDATE ItemTable SET value = '{}' WHERE key = 'vscode.git';"

Bug #2: SCM Repositories Flash and Disappear on Workspace Open

Symptoms

  1. Open a multi-root .code-workspace file containing 3+ git repositories
  2. All repositories briefly appear in the Source Control panel (~0.5-1 second)
  3. All but one repository disappears
  4. The remaining visible repository is typically the first folder or one previously opened
  5. No way to manually re-add the hidden repositories via UI

Root Cause

Cursor stores SCM visibility state in a SQLite database (state.vscdb) within each workspace’s storage directory at:

~/Library/Application Support/Cursor/User/workspaceStorage/<hash>/state.vscdb

The problematic key is scm:view:visibleRepositories:

{
  "all": [
    "git:Git:file:///path/to/repo1",
    "git:Git:file:///path/to/repo2",
    "git:Git:file:///path/to/repo3"
  ],
  "sortKey": "discoveryTime",
  "visible": [0]  // <-- BUG: Only index 0 is visible
}

The visible array should contain [0, 1, 2] but gets corrupted to [0].

Additional failure mode: Cursor sometimes creates a new single-folder storage instead of using the existing workspace storage. The workspace.json file shows:

// Wrong (single folder):
{ "folder": "file:///path/to/first/repo" }

// Correct (workspace file):
{ "workspace": "file:///path/to/my.code-workspace" }

Related Bug: Closed Repositories Can’t Be Reopened

The vscode.git key stores closedRepositories:

{
  "closedRepositories": ["/path/to/repo2", "/path/to/repo3"]
}

Once a repository is in closedRepositories, there’s no UI to re-open it.

Workaround / Fix

Before opening the workspace, clear the problematic SQLite state:

# Find workspace storage
WS_FILE="$HOME/.workspaces/my.code-workspace"
STORAGE=$(grep -l "$WS_FILE" ~/Library/Application\ Support/Cursor/User/workspaceStorage/*/workspace.json 2>/dev/null | head -1 | xargs dirname)

# Clear problematic keys
sqlite3 "$STORAGE/state.vscdb" "DELETE FROM ItemTable WHERE key = 'scm:view:visibleRepositories';"
sqlite3 "$STORAGE/state.vscdb" "UPDATE ItemTable SET value = '{}' WHERE key = 'vscode.git';"

If wrong storage was created (single folder instead of workspace):

# Find and remove the wrong storage
grep -l "path/to/folder" ~/Library/Application\ Support/Cursor/User/workspaceStorage/*/workspace.json
# Delete that directory, then reopen the .code-workspace file

Reproduction Steps

  1. Create a .code-workspace file with 3+ folders (each a git repo)
  2. Open it in Cursor
  3. Source Control shows all repos briefly, then only one remains
  4. Check state.vscdb:
    sqlite3 "$STORAGE/state.vscdb" "SELECT value FROM ItemTable WHERE key = 'scm:view:visibleRepositories';"
    
  5. Observe visible array only contains [0]

Expected Behavior

All repositories in the workspace should remain visible in Source Control, or there should be a UI option to show/hide repositories.

Requested Fix

  1. Initialize visible array to include all discovered repositories
  2. Add UI to show hidden repositories (right-click menu or command palette)
  3. Don’t persist closedRepositories without a way to undo

Feature Requests:

  1. “Reopen Repository” in Source Control context menu
  2. “Show All Repositories” button
  3. Clear stale state when .code-workspace changes
1 Like

cc @deanrie

Thanks for the detailed investigation - this is very valuable information with exact reproduction steps and root causes of both bugs.

I’ll pass this to the development team. Your workarounds using SQLite are the right temporary solution. I’ll keep you updated on the progress.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.