using-git-worktrees

Create isolated Git worktrees for feature branches with setup and test verification.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/luiztrilha/dunderia-public --skill using-git-worktrees-luiztrilha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/luiztrilha/dunderia-public/tree/main/templates/local-runtime-profile/skills/superpowers/using-git-worktrees
Command: npx skills add https://github.com/luiztrilha/dunderia-public --skill using-git-worktrees-luiztrilha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides a systematic approach to creating isolated Git workspaces for feature development, ensuring clean codebases and avoiding merge conflicts.

Core Features & Use Cases

  • Isolation: Creates Git worktrees that share the same repository but allow independent development.
  • Smart Directory Selection: Prioritizes project-local .worktrees directory, then checks for worktrees or user-specified location.
  • Safety Verification: Ensures directories are ignored in .gitignore to prevent accidental commits.
  • Automated Setup: Detects project type and runs setup commands like npm install or cargo build.
  • Baseline Verification: Executes tests to ensure a clean start before development.
  • Use Case: Ideal for when you need to develop a new feature in a separate branch without affecting the main codebase.

Quick Start

Run the using-git-worktrees skill to set up an isolated workspace for your feature branch.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I use git worktrees to isolate feature branches and prevent code pollution?

Git worktrees create isolated workspaces sharing the same repository, allowing independent feature branch development without polluting the main codebase. This prevents merge conflicts by keeping separate directories for each branch.

What is the best way to manage multiple git branches without switching contexts constantly?

Using git worktrees is the best way to manage multiple branches without switching contexts. It creates separate directories for each branch, enabling parallel development and maintaining a clean codebase.

How do I ensure my git worktree directory is ignored to prevent accidental commits?

To prevent accidental commits, verify that your worktree directory is added to .gitignore. The setup prioritizes a project-local .worktrees directory and performs safety verification to ensure it is ignored.

Can I automatically run project setup commands like npm install when creating a git worktree?

Yes, automated setup detects the project type and runs appropriate setup commands like npm install or cargo build. It also executes tests to verify a clean baseline before you start development.

Does using git worktrees require specific directory configurations for branch management?

Git worktrees require a directory configuration that is ignored in .gitignore. The setup smartly selects a location by prioritizing a project-local .worktrees directory, then checking for worktrees or user-specified locations.

Why should I run tests before starting development in a new git worktree?

Running tests before development ensures a clean baseline and verifies the isolated workspace is correctly configured. This safety step confirms the automated setup commands successfully initialized the project.