Git Worktrees

Manage multiple Git worktrees for parallel development in separate directories.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/MacPhobos/research-mind --skill git-worktrees-macphobos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git Worktrees
Source: https://github.com/MacPhobos/research-mind/tree/main/.claude/skills/universal-collaboration-git-worktrees
Command: npx skills add https://github.com/MacPhobos/research-mind --skill git-worktrees-macphobos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill allows developers to manage multiple branches of a Git repository simultaneously in separate directories, eliminating the need to constantly switch branches and context.

Core Features & Use Cases

  • Parallel Development: Work on different features or fixes concurrently.
  • Isolated Environments: Maintain separate working directories for bug fixes, feature development, and code reviews.
  • Use Case: You are working on a new feature (feature-A) but need to urgently fix a bug on the main branch. You can create a new worktree for the bugfix branch without disrupting your feature-A work.

Quick Start

Create a new worktree for the 'hotfix-urgent' branch in the '../worktrees/hotfix-urgent' directory.

Frequently Asked Questions about Git Worktrees

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

FAQPage Schema
How do I work on a hotfix without switching my current Git branch?

Git worktrees let you manage multiple branches simultaneously in separate directories, allowing you to create an isolated worktree for an urgent hotfix without disrupting your current feature development context.

What is a Git worktree and when do I need one for parallel development?

A Git worktree maintains a distinct working directory linked to your repository, needed when you want isolated task execution for stacked PRs or code reviews without the overhead of frequent branch switching.

Can I do stacked PR development using Git worktrees?

Yes, Git worktrees support stacked PR development by maintaining distinct working directories for different branches within the same repository, enabling isolated task execution across your stacked changes.

How do I create a new worktree for an urgent bugfix branch?

To create a worktree, specify a target directory like '../worktrees/hotfix-urgent' and the branch name, generating an isolated working environment for your bugfix without altering your primary directory.

Does managing multiple Git worktrees require extra dependencies?

No, this workflow requires no extra dependencies, utilizing Git's native worktree functionality to maintain separate working directories for bug fixes, feature development, and code reviews.

What is the best way to review code across different branches?

Git worktrees provide the best way to review code across different branches by creating isolated environments, allowing you to checkout multiple branches concurrently in separate directories without switching context.