git-worktrees

Automate Git worktree creation and management for parallel development.

225|62|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/lexler/skill-factory --skill git-worktrees-lexler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktrees
Source: https://github.com/lexler/skill-factory/tree/main/output_skills/developer-tools/git-worktrees
Command: npx skills add https://github.com/lexler/skill-factory --skill git-worktrees-lexler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing multiple long-running branches in a single repository is error-prone and slows development. Git worktrees let you split work into isolated, removable directories without duplicating the entire history.

Core Features & Use Cases

  • Create parallel worktrees for feature work without cluttering the main repo.
  • Easily switch between worktrees and branches, reducing context switching.
  • Use-case: develop feature A in one worktree and bugfix B in another, then merge back to main.
  • Use-case: experiment with refactors without affecting the main development tree.

Quick Start

Create a new worktree for a feature: PROJECT=$(basename "$PWD") WORKTREES_DIR="../${PROJECT}_worktrees" mkdir -p "$WORKTREES_DIR" git worktree add "${WORKTREES_DIR}/feature_1" -b "feature_1"

Frequently Asked Questions about git-worktrees

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

FAQPage Schema
How do I manage multiple long-running Git branches without slowing down development?

Git worktrees let you split work into isolated, removable directories without duplicating the entire history, enabling efficient parallel development. This prevents errors and context switching when managing multiple feature branches.

How do I create a git worktree for a new feature branch?

To create a git worktree, make a directory for your worktrees and run `git worktree add` with the target path and `-b` flag for your new branch. This isolates feature development from your main repository tree.

Does git worktree require external software beyond Git to manage parallel branches?

No, git worktree management relies entirely on standard Git commands including `worktree add`, `list`, and `remove`. It requires no external software, dependencies, or additional tools beyond a standard Git installation.

What is the best way to develop a feature and a bugfix in parallel within the same repository?

The best way is creating isolated git worktrees for each task, allowing you to develop feature A in one worktree and bugfix B in another simultaneously. You can then merge both back to main independently.

Can I use git worktrees to experiment with refactors without affecting the main development tree?

Yes, git worktrees provide isolated workspaces for refactoring experiments without affecting your main development tree. You can create a removable directory to test changes and safely remove it when finished.

Why should I use git worktrees instead of cloning a repository multiple times?

Git worktrees let you split work into isolated directories without duplicating the entire history, unlike repository cloning. This saves disk space and simplifies branch management while enabling parallel feature development.