git-worktrees

Automates creation and management of isolated Git worktrees for parallel development.

4|Updated Sep 6, 2013
One-click install
npx skills add https://github.com/mway/dotfiles --skill git-worktrees-mway
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktrees
Source: https://github.com/mway/dotfiles/tree/main/home/dot_codex/skills/git-worktrees
Command: npx skills add https://github.com/mway/dotfiles --skill git-worktrees-mway

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees enable safe, isolated working directories for parallel branches, allowing multiple features to be developed without disrupting the main repository.

Core Features & Use Cases

  • Isolated working directories for parallel branches without changing the current HEAD.
  • Safe directory selection and verification before creating a worktree.
  • Preflight checks and guidance to reuse or rename paths and branches.
  • Auto-detection of project setup commands (e.g., npm, cargo, pip) for smooth environment preparation.

Quick Start

Create a new worktree for your current Git project by specifying a branch name and following the prompts.

Frequently Asked Questions about git-worktrees

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

FAQPage Schema
How do I create isolated Git worktrees for parallel branch development?

To create isolated Git worktrees for parallel branch development, the automation safely selects and verifies a new directory path without changing your current HEAD, allowing you to work on multiple features simultaneously. It also runs preflight checks to prevent path conflicts.

What is the best way to manage multiple Git branches without switching commits constantly?

Managing multiple Git branches without switching commits is best achieved using Git worktrees, which provide isolated working directories for each branch. This allows parallel development and experimentation without disrupting your main repository state.

Can I auto-setup project environments when creating a new Git worktree?

Yes, you can auto-setup project environments when creating a new Git worktree. The tool auto-detects common project setup commands like npm, cargo, or pip, and optionally runs them to ensure your environment is prepared immediately after worktree creation.

Does Git worktree creation verify directory paths to prevent branch conflicts?

Git worktree creation includes safe directory selection and verification to prevent branch and path conflicts. It performs preflight checks and provides guidance to reuse or rename paths, ensuring you do not overwrite existing work.

Why should I use Git worktrees instead of cloning repositories for feature branches?

Git worktrees provide isolated working directories for parallel branches while sharing a single repository history, saving disk space and sync time compared to cloning. They enable safe, localized experimentation without altering the main repository HEAD.

What are the limitations of using Git worktrees for multi-branch workflows?

Git worktrees require careful directory management to avoid path conflicts, though preflight checks help mitigate this. You must also ensure isolated environments are properly configured, as the worktree itself only manages files, not external state.