microsoft / microsoft/vscode

Add a setting to disable the integrated Git worktrees UI (Source Control listing + branch checkout prompts)

Open
#324,494 6 comments 6 reactions 1 assignee Claimed by @lszomoru View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

- VS Code Version: 1.122.1 (commit 8761a5560cfd65fdd19ce7e2bd18dab5c0a4d84e, x64)
- OS Version: Linux x64 (Arch, kernel 7.0.10)

### The request

Please add a setting to fully opt out of the integrated Git worktrees UI. Concretely, a way to disable:

1. The **worktrees listing** in the Source Control view, and
2. The **worktree-aware prompts** on branch checkout.

Some of us deliberately keep each worktree as an independent, self-contained window and never want cross-worktree UI. Today there is no setting that turns this off. This setting was still available until a recent update.

### Steps to Reproduce

1. Create a repo with two linked worktrees, e.g. `repo/` (primary) and `repo-secondary/` (a `git worktree` of it on a different branch).
2. Set `"git.detectWorktrees": false` (and `"git.detectWorktreesLimit": 0`).
3. Open only `repo/` in a window.

Observed:
- The other worktree still shows up in the Source Control view (worktrees are listed regardless of `git.detectWorktrees`).
- Switching to a branch that is checked out in the other worktree triggers a worktree prompt/conflict dialog instead of just performing (or refusing) the checkout in the current worktree.

Expected (with an opt-out setting enabled):
- No worktree listing in Source Control for the current window.
- No worktree prompts; branch operations act only on the worktree of the current window.

### Suggestion

A single opt-out, e.g. `"git.worktrees.enabled": false` (or `"git.showWorktrees": false`), that suppresses the worktrees artifact group in Source Control and skips the worktree-aware branch prompts, so each worktree window behaves as a standalone repository.

Related: #278774 (closed; only flipped the default), #298496 (about the Copilot agent creating worktrees, not the SCM UI).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.