using-git-worktrees

Creates isolated Git worktrees with auto-setup and test validation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/enantiomer-h/DotfilePub --skill using-git-worktrees-enantiomer-h
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/enantiomer-h/DotfilePub/tree/main/claude-code/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/enantiomer-h/DotfilePub --skill using-git-worktrees-enantiomer-h

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees let you work on multiple branches in parallel without switching your current workspace, enabling isolated experimentation while keeping the main repository intact.

Core Features & Use Cases

  • Directory priority and safety: prefer existing directories (.worktrees, then worktrees), optionally honor CLAUDE.md, and prompt the user if needed to choose a location.
  • Safety verification: ensure a worktree directory is ignored by gitignore before creation; if not ignored, automatically update .gitignore, commit, and proceed.
  • Flexible placement: supports project-local worktrees and a global location for organization-wide use, with automatic project-name inference.
  • Auto-setup and validation: auto-detect project tooling (Node.js, Rust, Python, Go) and install/build as appropriate; run tests to ensure a clean baseline.
  • Clear reporting: provide a final status with the location of the worktree, test results, and next-step readiness.

Quick Start

Create an isolated git worktree for the current project, branch naming it after your feature, verify the ignore rules, run auto-setup if a tool is detected, and confirm a clean test baseline.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I create an isolated Git worktree for feature development?

To create an isolated Git worktree, the Skill applies a specified branch to a project-local directory like .worktrees or a global path, switching you to the new branch without disturbing the main workspace. It handles directory selection and setup automatically.

What is the best way to manage multiple Git branches in parallel without switching my workspace?

Using Git worktrees is the best way to manage multiple branches in parallel, allowing isolated experimentation while keeping the main repository intact. The Skill automates worktree creation, branch application, and workspace isolation.

Does Git worktree auto-setup run project installation commands for Node.js, Rust, and Python?

Yes, Git worktree auto-setup detects project tooling for Node.js, Rust, Python, and Go, automatically running the appropriate install or build commands like npm install, cargo build, or pip install to prepare the isolated environment.

How does creating a worktree handle gitignore verification and safety?

Creating a worktree verifies that the target directory is ignored by gitignore before creation. If the directory is not ignored, it automatically updates .gitignore, commits the change, and proceeds with worktree setup safely.

Can I use a global location instead of project-local directories for Git worktrees?

Yes, you can use a global location for organization-wide Git worktrees instead of project-local directories like .worktrees. The Skill supports flexible placement with automatic project-name inference for both local and global paths.

Why should I validate a clean test baseline after setting up a Git worktree?

Validating a clean test baseline after Git worktree setup ensures the isolated environment is correctly configured and ready for feature work. The Skill auto-runs project tests to confirm everything passes before you begin development.