git_worktree

Create, list, switch, and clean up Git worktrees with environment file copying.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/sammyjoyce/pi-compound-engineering --skill git-worktree-sammyjoyce
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git_worktree
Source: https://github.com/sammyjoyce/pi-compound-engineering/tree/main/skills/git-worktree
Command: npx skills add https://github.com/sammyjoyce/pi-compound-engineering --skill git-worktree-sammyjoyce

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill simplifies the management of Git worktrees, providing a streamlined way to create, switch between, and clean up isolated development environments without the hassle of stashing or complex Git commands.

Core Features & Use Cases

  • Isolated Development: Create clean, separate worktrees for new features or bug fixes.
  • Environment Management: Automatically copies common .env files into new worktrees.
  • Simplified Workflow: Wraps git worktree commands for easier use.
  • Use Case: When starting a new feature, create a dedicated worktree to keep your main branch clean and avoid merge conflicts.

Quick Start

Use the git worktree skill to create a new worktree for the 'feature-x' branch.

Frequently Asked Questions about git_worktree

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

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

Git worktrees are managed by creating, listing, switching, and cleaning up separate directories for different branches. This approach facilitates isolated parallel development and code review by maintaining distinct environments without stashing changes or using complex Git commands.

What's the best way to create separate Git environments for feature branches?

Creating dedicated Git worktrees for new features or bug fixes provides clean, isolated development environments. This workflow keeps your main branch clean and automatically copies common .env files into the new worktree directories to manage environment configurations.

How does Git worktree cleanup work for inactive branches?

Git worktree cleanup works by tracking and removing inactive worktree directories efficiently. The process integrates with Git to ensure obsolete worktrees are cleaned up, preventing clutter from accumulated isolated development environments across various branches.

Can I copy .env files automatically when creating a new Git worktree?

Yes, .env files are automatically copied into new worktrees during creation. This environment management feature ensures that each isolated development directory has the necessary configuration files ready immediately without manual copying.

When do I need to use Git worktrees instead of standard branching?

Git worktrees are needed when you want to work on multiple branches simultaneously without stashing changes or constantly switching contexts. They allow you to maintain separate directories for each branch, keeping your main branch clean and avoiding merge conflicts during parallel development.

Do I need additional dependencies to run Git worktree operations?

No additional dependencies are required to run Git worktree operations. The workflow wraps standard Git commands to create, list, switch, and clean up worktrees, relying solely on your existing Git installation for version control and branch management.