🧩 VS Code Git WorktreesA wrapper for Git Worktree operations that provides an interactive API so developers can manage worktrees more easily — without switching between the terminal and VS Code. 🎯 Purpose of the ExtensionAfter creating a ZSH plugin for Git operations, I noticed how often I switched between the terminal and my main editor (VS Code). To streamline my workflow, I built this extension to keep everything inside VS Code. ⚙️ Requirements
🧪 Multiple Workspaces SupportThis extension supports multiple workspaces. Here's how it works:
✅ Select a workspace from the list → the operation will run in that workspace. 🛠️ Supported Operations➕
|
| 🏷️ Property | 🧩 Type | 🛠️ Default | 📃 Description |
|---|---|---|---|
vsCodeGitWorktrees.remove.stalledBranches |
boolean |
false |
Remove local (stalled) branches that no longer exist on the remote |
vsCodeGitWorktrees.move.openNewVscodeWindow |
boolean |
true |
Open a new VS Code window when switching or creating a worktree |
vsCodeGitWorktrees.move.preserveSubfolder |
boolean |
true |
When switching or creating a worktree, open the same relative subfolder you were in (e.g. a monorepo package). Falls back to the worktree root if missing |
vsCodeGitWorktrees.worktrees.dir.path |
string |
null |
Directory where new worktrees are created as {dir}/{branch}, e.g. ${userHome}/worktrees. If unset, worktrees are created as siblings of the main repo |
vsCodeGitWorktrees.add.autoPush |
boolean |
true |
Automatically push the new worktree branch after creation |
vsCodeGitWorktrees.add.autoPull |
boolean |
true |
Automatically pull updates after creating a new worktree branch |
vsCodeGitWorktrees.worktreeCopyIncludePatterns |
array |
[] |
Files and folders to copy from the source repo to the new worktree, e.g. [".venv", "docs/tmp"] |
vsCodeGitWorktrees.worktreeCopyExcludePatterns |
array |
[] |
Files and folders to exclude from the worktree copy, e.g. ["tmp", "target"] |
vsCodeGitWorktrees.worktree.coloring |
boolean |
false |
Enable color labels when creating or switching worktrees |
vsCodeGitWorktrees.worktreeSearchPath |
string |
null |
Optional subdirectory (relative or absolute) where Git repositories can be found if the root workspace is not a Git repository, e.g. ${userHome}/worktrees |
Contributing
We welcome all contributions, issues and feature requests, whether small or large. If you want to contribute, feel free to check out our issues page and our guidelines.



