A Visual Studio extension that provides an intuitive interface for managing Git worktrees directly within the IDE.
| IDE | Marketplace | Description |
|---|---|---|
| Visual Studio | Git Worktree Manager | Extension for Visual Studio 2022 (17.14+) |
Visual Studio's default Git interface doesn't natively expose worktree management. This extension bridges that gap:
- Zero Setup & Dependencies: You don't need Git installed on your PC or configured in your
PATH—it uses Visual Studio's built-in Git automatically. - Side-by-Side Multi-Branch Workflows: Work on multiple features or bug fixes simultaneously in separate, clean folders without stash/checkout/rebuild cycles.
- Seamless VS Integration: Create, switch, prune, and manage worktrees entirely from the IDE. Open solutions in new Visual Studio instances with a single click.
- Repository-Aware Hierarchy: Easily browse all your worktrees cleanly grouped by parent repository and branch.
- Smart Path Display: Automatically shows the shortest unique path for each worktree, making them easy to identify at a glance even when sharing common parent directories.
Access the Git Worktree tools directly from the Visual Studio menu under Git > Git Worktree or use the default hotkeys:
- Create Worktree:
Ctrl+Shift+= - Manage Worktrees:
Ctrl+Shift+\
Create new worktrees easily with the Create Worktree dialog:
- Choose any branch from the searchable list.
- Path is auto-generated based on the branch name, or you can customize it.
- Toggle options to force creation or immediately open the new worktree in Visual Studio.
Manage all your worktrees in a dedicated sidebar/tool window:
- Displays worktrees grouped by repository.
- Clearly identifies the current and main worktrees with badges (CURRENT, MAIN).
- Integrated search and filter bar lets you locate worktrees quickly by branch or folder name.
Selecting a worktree reveals its details, helping you see its status without opening the worktree:
- Staged & Changes: View files that have changes.
- Untracked Files: View new untracked files.
- Outgoing Commits: Inspect commits that are ready to push.
Right-click any worktree node to trigger context menu actions:
- Open in Visual Studio: Open the selected worktree in a new Visual Studio instance.
- Open in Explorer: Reveal the folder in Windows File Explorer.
- Copy Path: Copy the absolute worktree path to clipboard.
- Remove / Force Remove: Clean up the worktree safely. The extension blocks removing the active or main worktrees, and prompts for confirmation if there are uncommitted changes.
Configure the default behaviors under Git > Settings > Source Control > Git Worktree:
- Default Worktree Directory: Set an absolute path where new worktrees will be created. If left empty, defaults to a sibling
<repo>_Worktreesfolder. (Ignored when a Worktree Sub-Folder is specified). - Worktree Sub-Folder: Define a folder created inside the repository itself (e.g.
.worktrees) to hold worktrees. (When set, this takes precedence over the Default Worktree Directory). - Preserve Branch Hierarchy: Toggle whether to preserve the branch folder structure in worktree paths (e.g.
feature/foobecomesWorktrees\feature\foovsWorktrees\feature-foo).
All Git execution commands, warnings, and diagnostic messages are cleanly logged to Visual Studio's Output Window under the Git Worktree pane.
- Visual Studio 2022 (17.14 or later)
- Active Git repository or solution open in Visual Studio
This project is licensed under the MIT License.
Requires the .NET 10 SDK.
# Clone the repository
git clone https://github.com/MrRazor22/GitWorkTree.git
# Open in Visual Studio
start GitWorkTree.sln
# Build
dotnet build
# Run tests
dotnet test





