git-worktree

Create, list, and remove git worktrees across branches.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/theslashdojo/dojo --skill git-worktree-theslashdojo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/theslashdojo/dojo/tree/main/nodes/git/worktree
Command: npx skills add https://github.com/theslashdojo/dojo --skill git-worktree-theslashdojo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, and includes scripts (resource) components.

What problem does it solve?

Work across multiple branches without constant stashing or context switching by using linked git worktrees.

Core Features & Use Cases

  • Parallel development: spin up separate directories for different branches, enabling simultaneous work.
  • Safe experimentation: keep hotfixes, feature work, and code reviews isolated yet share the same repository.
  • Agent-friendly: spawn sub-agents in separate worktrees to run tasks in parallel.
  • Common patterns: hotfix while developing, code review, or parallel testing across branches.

Quick Start

Create a new worktree for an existing branch using git worktree add <path> <branch> and start working in the new directory.

Frequently Asked Questions about git-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I work on multiple git branches at the same time without stashing changes?

Using git worktree allows you to manage multiple branches in parallel by creating separate linked directories. This enables simultaneous work across branches without stashing or switching contexts, sharing a single repository object database.

What is the best way to review pull requests or test hotfixes without disrupting my current branch?

Git worktree lets you isolate pull request reviews or hotfixes in separate directories while sharing the same repository. You can spin up a linked worktree for safe experimentation without stashing or disrupting your current development context.

Can I run parallel testing across different git branches using separate directories?

Yes, you can enable parallel testing by creating multiple git worktrees across branches. Each worktree acts as an isolated directory allowing you to run tests against multiple branches simultaneously without constantly switching contexts.

Does git worktree support spawning sub-agents for parallel development tasks?

Git worktree is agent-friendly, allowing you to spawn sub-agents in separate worktrees to execute tasks in parallel. This workflow is managed via scripts that handle worktree creation, listing, and removal.

Are there limitations when using git worktree for branch management?

Git worktree enforces a one-branch-per-worktree rule and prohibits nested worktrees to maintain repository integrity. You need git installed as a dependency to utilize the script-based manager for these parallel workflows.

How do I create a new worktree for an existing branch?

To create a worktree, run git worktree add <path> <branch> to generate a separate working directory linked to your repository. You can then start working in this new directory immediately for parallel development.