git-worktree

Manage multiple Git branches concurrently using worktrees in separate directories.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/baphled/dotopencode --skill git-worktree-baphled
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/baphled/dotopencode/tree/main/skills/git-worktree
Command: npx skills add https://github.com/baphled/dotopencode --skill git-worktree-baphled

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers manage multiple branches and tasks simultaneously without the overhead of stashing or context switching within a single repository clone.

Core Features & Use Cases

  • Parallel Development: Work on different features or bug fixes in isolated directories.
  • Efficiency: Saves disk space and keeps branches synchronized by sharing the .git directory.
  • Use Case: Quickly switch to fix a production bug while a long-running feature is being developed, without disrupting the feature work.

Quick Start

Use the git-worktree skill to add a new worktree for the 'hotfix-branch' on the 'origin/main' branch.

Frequently Asked Questions about git-worktree

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

FAQPage Schema
How do I manage parallel development with Git without stashing or switching branches?

Git worktrees enable parallel development by linking multiple working directories to a single repository, allowing you to manage multiple branches concurrently without stashing or switching.

What is the best way to fix a production bug while keeping my local feature branch intact?

The best way is using Git worktrees to create an isolated directory for the hotfix branch, allowing you to address the production bug immediately without disrupting your ongoing feature branch work.

Does using Git worktrees save disk space compared to multiple repository clones?

Yes, Git worktrees optimize disk usage by sharing a single central .git directory across all linked working directories, keeping branches synchronized without duplicating repository history.

How do I add a new worktree for a hotfix branch from the origin/main branch?

To add a new worktree for a hotfix branch, use the git-worktree skill to specify the target branch and base it on origin/main, creating an isolated directory for your changes.

Can I work on separate tasks in distinct directories using a single Git repository?

Yes, you can work on separate tasks in distinct directories by leveraging Git worktrees, which provide isolation for different features while maintaining shared state via the central .git directory.

When should I use Git worktrees instead of standard branch switching?

You should use Git worktrees instead of standard branch switching when you need to manage multiple branches concurrently, such as running a long-running feature while quickly fixing a bug in another directory.