Microsoft/vscode
View on GitHub[Bug] Git Worktree menu does not appear in command palette with git.detectWorktrees enabled over SSH
Open
#264,209 opened on Aug 31, 2025
buggithelp wanted
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.103.2 (Universal)
- OS Version: macOS 15.6.1 (24G90) and Ubuntu 22.04.5 LTS (remote)
Steps to Reproduce:
- Connect to a remote Ubuntu 22.04.5 LTS machine (e.g., AWS EC2) from a macOS client via the Remote - SSH extension.
- In the remote terminal, create a Git repository and a worktree using the command:
git worktree add ../new-worktree main - Open the
new-worktreedirectory in VS Code. - Set
"git.detectWorktrees": truein your settings. - Reload the VS Code window.
- Open the command palette (
Cmd+Shift+P) and typeworktree.
Expected Behavior
The command palette should display Git Worktree-related commands, such as Git: Worktree, allowing for easy management of the worktree from the VS Code UI.
Actual Behavior
No worktree-related commands appear in the command palette.
Additional Context
- The issue persists even after performing a clean reinstallation of both VS Code and Git.
- The Git version on the remote machine is
2.34.1, which meets the requirement for the feature. - Running
git worktree liston the remote terminal correctly lists the worktree. - The VS Code developer console shows no errors related to
gitorworktree. - The issue persists even after setting
git.showOutputtoalwaysand inspecting the output logs. No relevant commands or errors were observed. - Manually created worktrees are correctly referenced in the Source Control view (e.g., the branch name is displayed), but the specific worktree commands are absent.
- This problem seems to be specific to the remote SSH connection environment, as it doesn't occur with local repositories.