Git extension falsely detects repository in empty/new window after updating to latest version

Open
#320,041 0 comments 0 reactions 1 assignee View on GitHub

@lszomoru is already working on this.

Since Jun 5, 2026.

Assessment

This issue has not been assessed yet.

Description

VS Code Version
Version: 1.123.0 (Universal)
Commit: 6a44c352bd24569c417e530095901b649960f9f8
Date: 2026-06-03T11:29:03+02:00 (2 days ago)
Electron: 42.2.0
ElectronBuildId: 14159160
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Darwin arm64 24.6.0 (macOS Sequoia)

Bug Description
Immediately after upgrading to the latest VS Code release (v1.123.0), opening a completely new, blank window (via Cmd + N or File > New Window) causes the built-in Git extension to incorrectly initialize a Git repository
.
The Source Control panel activates and shows thousands of pending changes, scanning upward into a parent directory. Crucially, the File Explorer behaves correctly and remains completely empty (showing only the "You have not yet opened a folder" state), while the Source Control panel is independently stuck tracking a rogue root repository.

This decoupling of the Source Control state from the Explorer state did not occur in previous versions.

Steps to Reproduce
Update VS Code to version 1.123.0 and allow it to restart.
Open a brand new instance/window with no folder or workspace loaded (File > New Window).
Observe the Sidebar. The File Explorer correctly indicates no folder is open, but the Source Control panel activates anyway and begins tracking thousands of changes from a parent or home directory.

Expected Behavior
A newly opened, empty window with no active folder or workspace should not trigger Git repository detection. If the Explorer has no open workspace, the Source Control panel should remain idle.

Actual Behavior
The Git extension auto-detects a repository (likely from a legacy or root .git folder in a parent path) and initializes version control tracking in the Source Control panel exclusively, while the Explorer view remains completely un-focused and empty.

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.