using-git-worktrees

Create isolated git worktrees with automatic project setup.

12|2|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/aman-2709/superpowers-ecc --skill using-git-worktrees-aman-2709
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/aman-2709/superpowers-ecc/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/aman-2709/superpowers-ecc --skill using-git-worktrees-aman-2709

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Starting feature work in the main repository can risk local changes or branching conflicts. This skill creates isolated git worktrees that share the same repository but run on separate branches, providing safe, independent workspaces.

Core Features & Use Cases

  • Automatic worktree discovery and selection (prefers hidden .worktrees, then standard worktrees, then asks for preference).
  • Built-in safety verification to ensure project-local worktrees are ignored by git, with automatic fallback to updating .gitignore and committing changes when needed.
  • Automatic per-project setup detection (Node.js, Rust, Python, Go) and execution to prepare the new workspace.
  • Handles feature work, experiments, and bugfixes that require isolation from the main working directory.

Quick Start

Tell me the project name and the target branch, and I will create a safe, isolated git worktree ready for development.

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 work?

To create an isolated git worktree, provide the project name and target branch. The system discovers directories, verifies ignore rules, safely creates the worktree, and runs automatic project-setup steps for common toolchains.

Why use git worktrees instead of branching in the main repository?

Git worktrees provide safe, independent workspaces by running separate branches outside the main working directory. This prevents local changes or branching conflicts when starting new feature work or experiments.

Does creating git worktrees automatically handle project setup for Node.js, Rust, Python, and Go?

Yes, git worktree creation includes automatic per-project setup detection for Node.js, Rust, Python, and Go toolchains. It prepares the new workspace by executing the appropriate setup steps for the detected environment.

What happens if my project-local git worktrees are not ignored by git?

If project-local git worktrees are not ignored, built-in safety verification triggers an automatic fallback. This fallback updates the .gitignore file and commits the necessary changes to ensure worktrees remain properly isolated.

Can I use git worktrees for bugfixes and experiments that require isolation?

Yes, git worktrees handle feature work, experiments, and bugfixes that require isolation from the main working directory. They share the same repository but operate on separate branches for independent development.

How does worktree discovery work when creating a new isolated workspace?

Worktree discovery prefers hidden .worktrees directories first, then checks standard worktree locations. If no preference is found automatically, the system asks for your preference before safely creating the isolated workspace.