Skip to content

MrQudratUllah/worktrees-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Worktrees+

Parallel git worktrees for feature work and PR reviews β€” UI-first.

Version Installs License: MIT

Stop stashing. Stop switching branches mid-task. Open every PR review and every feature branch as its own VS Code window β€” each with its own files, terminal, and dev server β€” without leaving the editor.

Install

πŸ’‘ If the Marketplace listing isn't live yet, use Option 2 (GitHub release) below.

Option 1 β€” From the VS Code Marketplace (recommended)

  1. Open VS Code
  2. Open the Extensions panel (Cmd+Shift+X on Mac, Ctrl+Shift+X on Windows/Linux)
  3. Search for Worktrees+
  4. Click Install

Or install from the command line:

code --install-extension qudratullah.worktrees-plus

Option 2 β€” From a .vsix (latest GitHub release)

If you want the bleeding-edge build before it hits the marketplace, or you work offline:

  1. Go to the Releases page
  2. Download the .vsix file from the Assets section (e.g. worktrees-plus-0.3.0.vsix)
  3. In VS Code, open the Extensions panel
  4. Click the ... menu at the top of the panel
  5. Pick "Install from VSIX..."
  6. Select the downloaded file
  7. Click Reload when prompted

Alternatively, drag the .vsix file directly onto the Extensions panel.

Option 3 β€” Build from source

For developers who want to inspect or modify the code first:

git clone https://github.com/qudratullah/worktrees-plus.git
cd worktrees-plus
npm install
npm run compile
npx @vscode/vsce package      # produces worktrees-plus-X.Y.Z.vsix
code --install-extension worktrees-plus-*.vsix

Requirements

  • VS Code 1.85 or newer
  • Git 2.40 or newer (any modern install works)

After install

Look for the branched-fork icon in the left activity bar. Click it to open the Worktrees panel. If the icon doesn't appear, run "Developer: Reload Window" from the command palette.

Why?

Git worktrees let you check out multiple branches simultaneously, each in its own folder. But the CLI is awkward, easy to forget, and doesn't handle the surrounding ceremony (gitignore, env files, install commands, opening windows).

Worktrees+ makes the entire workflow one-click:

  • New feature? Click +, type the branch name, get a fresh VS Code window with deps installed
  • PR to review? Click πŸ”€, enter the PR number, get an isolated detached worktree
  • Want to switch? Click the status bar, pick a worktree, jump to that window
  • Done? Click πŸ—‘οΈ, the folder and registration are cleaned up

No commands to memorize. No terminal commands to type.

Features

One-click worktree creation

Three buttons in the sidebar β€” feature branches, PR reviews, and existing branches β€” each handled with smart defaults.

Status at a glance

Every worktree row shows whether it has uncommitted changes (● 3), how far it's diverged from main (↑5 ↓2), and what state it's in (clean, dirty, detached, locked, or prunable).

Auto-install and auto-config

When a worktree is created, Worktrees+ automatically:

  • Adds .worktrees/ to your .gitignore
  • Copies gitignored config files (.env.local, etc.)
  • Detects your package manager (pnpm/yarn/npm/bun) and runs install
  • Opens the new worktree in its own VS Code window

PR review without commit risk

The "Review PR" command checks out the PR head as a detached HEAD worktree β€” so you literally can't accidentally commit to someone else's PR branch. When done, one click removes it entirely.

Status bar integration

The current worktree's branch is always visible in the bottom-left status bar. Click it to switch to any other worktree (opens in a new window).

Friendly errors

Instead of raw git error text, Worktrees+ translates errors into actionable messages:

  • "Already checked out" β†’ button to open the existing worktree
  • "Has uncommitted changes" β†’ button to Force Remove
  • Anything else β†’ "Show Log" button jumps to the Output channel for full git output

UI-first, command-fallback

Every action is available via the sidebar UI. Every action is also available in the command palette (Cmd/Ctrl+Shift+P β†’ type "Worktrees") for keyboard-driven workflows.

First-time use

Once installed:

  1. Open any git repository in VS Code
  2. Click the branched-fork icon in the left activity bar
  3. The Worktrees panel opens, showing your current repo
  4. To create your first worktree, click the + at the top of the panel
  5. Enter a branch name (e.g. feature/test-worktrees)
  6. Press Enter twice (accepts main as base branch)
  7. A new VS Code window opens on the new worktree, with dependencies installing in the terminal

To review a PR instead, click the πŸ”€ icon and enter a PR number.

Configuration

All settings live under worktreesPlus.*:

Setting Default Description
location subfolder Where to create worktrees: subfolder (inside repo), sibling (next to repo), or custom
subfolderName .worktrees Folder name when using subfolder mode
customPath "" Custom path when location=custom
autoInstall true Run npm/pnpm/yarn/bun install after creating a worktree
copyFiles [".env", ".env.local", ".env.development", ".env.development.local"] Gitignored files to copy into new worktrees
baseBranch main Default base branch for new feature worktrees
openInNewWindow true Open new worktree in new VS Code window after creation
showStatus true Show dirty file count and ahead/behind indicators next to each worktree

Commands

All commands available in command palette with Worktrees: prefix.

Command Description
Worktrees: New Feature Worktree... Create a worktree with a new branch
Worktrees: Checkout PR for Review... Fetch a PR head and create a detached worktree
Worktrees: Checkout Existing Branch as Worktree... Pick a local or remote branch, create a worktree
Worktrees: Switch Worktree... Quick-pick to open any worktree in a new window
Worktrees: Prune Stale Worktrees Clean up registrations for missing folders
Worktrees: Show Log Open the Output channel with full git command history

How PR review works

You: click πŸ”€ β†’ enter "1234"

Worktrees+ runs:
  git fetch origin pull/1234/head:pr-1234
  git worktree add --detach .worktrees/pr-1234 pr-1234
  cp .env.local .worktrees/pr-1234/
  cd .worktrees/pr-1234 && pnpm install
  code .worktrees/pr-1234 --new-window

You end up in a new VS Code window, on the PR's code, with dependencies installed, ready to test. Total: ~one click for you.

Compared to other extensions

The VS Code Marketplace has several worktree extensions. Worktrees+ aims to be the one with:

  • UI for everything β€” no command palette required, every action is a button
  • PR review as a first-class flow β€” built-in pull/N/head fetch, detached-HEAD safety
  • Polished error UX β€” actionable buttons instead of raw git output
  • Status visibility β€” see at a glance which worktrees have uncommitted work

If you find another extension serves you better, that's fine β€” open a GitHub issue letting me know what was missing, I'm happy to learn.

Known limitations

  • Worktrees can't share node_modules. With pnpm's content-addressed store this is cheap (hardlinks); with npm/yarn each worktree fully installs.
  • The PR fetch assumes GitHub's pull/N/head ref convention. Works for GitHub; GitLab and Bitbucket aren't supported in this version.
  • Multi-root workspaces: only the first folder's repo is currently managed.

Troubleshooting

The Worktrees icon doesn't appear in the activity bar.
Reload VS Code (Cmd/Ctrl+Shift+P β†’ "Developer: Reload Window"). If still missing, right-click an empty area of the activity bar and check that "Worktrees" is enabled.

"No git repository found in workspace".
Open a folder that contains a .git directory at its root. If the folder is correct but the message persists, your git may not be on your PATH β€” verify with git --version in a terminal.

PR review fails with "Could not find that PR or branch".
Make sure the PR number is correct and you have access to the repository. The extension assumes GitHub's pull/N/head convention β€” GitLab and Bitbucket aren't supported yet.

npm install runs but the dev server can't bind to port 3000.
Each worktree shares the host's ports. Only one worktree can run a dev server on any given port at a time. Stop the dev server in the other worktree first.

Need more detail? Open the Output channel: ... menu on the Worktrees panel β†’ "Show Log". Every git command run by the extension is logged there with timestamps.

Uninstall

  1. Open the Extensions panel (Cmd/Ctrl+Shift+X)
  2. Search for Worktrees+
  3. Click the gear icon β†’ Uninstall
  4. Reload when prompted

The extension does not store any data outside of VS Code's standard extension storage, so uninstalling removes it completely. Worktrees you created on disk remain β€” they're real git folders, not extension data. To remove them, use git worktree remove or just delete the folders.

Contributing

Issues and PRs welcome at github.com/qudratullah/worktrees-plus.

License

MIT β€” Β© 2026 Qudrat Ullah

About

A VS Code extension for managing git worktrees with a UI-first approach. Open every PR review and feature branch as its own VS Code window without leaving the editor.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors