using-git-worktrees

Create isolated Git worktrees with ignore validation and setup steps.

7.6k|721|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/jnMetaCode/superpowers-zh --skill using-git-worktrees-jnmetacode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/jnMetaCode/superpowers-zh/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/jnMetaCode/superpowers-zh --skill using-git-worktrees-jnmetacode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables developers to create isolated Git worktrees for concurrent feature work without modifying the main workspace, combining smart directory selection with safety checks.

Core Features & Use Cases

  • Smart directory selection: prioritizes existing local worktrees (.worktrees) or worktrees, with a global fallback option and CLAUDE.md guidance to decide when needed.
  • Safety and policy enforcement: validates that the chosen directory is ignored by Git to prevent accidental commits of worktrees, and reports or fixes violations.
  • End-to-end workflow: creates a new worktree with git worktree add, then runs project setup steps (e.g., install dependencies or build) as appropriate for the repository.

Quick Start

Create an isolated Git worktree for the current project using the preferred directory, with ignore checks and safety validations.

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 without affecting my main repository?

Git worktrees allow concurrent feature work by creating isolated working directories linked to your repository. This skill automates the creation process, applying smart directory selection and safety checks to prevent accidental commits.

How do I prevent accidentally committing my Git worktree directory?

To prevent accidental commits of Git worktrees, this skill validates that the chosen directory is ignored by Git. It automatically checks your .gitignore rules and reports or fixes any safety violations before creating the worktree.

Does the Git worktree creation process run project setup steps automatically?

Yes, the Git worktree creation process runs project setup steps automatically. After executing git worktree add, the skill performs necessary setup actions like installing dependencies or building the project to ensure immediate development readiness.

Can I specify a custom directory for Git worktrees if .worktrees does not exist?

You can specify a custom directory for Git worktrees through CLAUDE.md preferences. The skill prioritizes existing local .worktrees or worktrees folders but provides a global fallback and prompts for guidance when preferences are not specified.

What is the best way to manage multiple feature branches using isolated workspaces?

The best way to manage multiple feature branches is using isolated Git worktrees. This skill automates the creation of separate workspaces, allowing you to prototype features concurrently while enforcing safety policies to protect the main repository.