git-worktree

Automate Git worktree creation, listing, switching, and cleanup.

Updated Jan 10, 2026
One-click install
npx skills add https://github.com/KingInYellows/yellow-plugins --skill git-worktree-kinginyellows
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/KingInYellows/yellow-plugins/tree/main/plugins/yellow-core/skills/git-worktree
Command: npx skills add https://github.com/KingInYellows/yellow-plugins --skill git-worktree-kinginyellows

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, and includes scripts (resource) components.

What problem does it solve?

Git worktree management often leads to cluttered setups and risky commands. This Skill provides a safe, script-driven interface to create, list, switch, copy environment files, and cleanup isolated worktrees so developers can review PRs or develop multiple features in parallel without affecting the main working directory.

Core Features & Use Cases

  • Isolated parallel development: Create and manage separate worktrees for multiple feature branches.
  • Safe switching and inspection: Easily switch into a worktree with shell-ready commands and clear visibility of the current state.
  • Environment consistency: Auto-copy environment files (.env*) to new worktrees and maintain .gitignore hygiene.
  • Use Case: Review a PR in isolation by spawning a dedicated worktree for the PR branch and returning to main when done.

Quick Start

Create a new worktree for a feature branch and start coding in isolation.

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 parallel development without cluttering my repository?

Git worktree management can be safely automated using scripts to create, list, switch, and cleanup isolated worktrees. This enables parallel development workflows within a single repository without affecting the main working directory.

When do I need to use a Git worktree for reviewing pull requests?

A Git worktree is needed when you want to review a PR in isolation. It spawns a dedicated worktree for the PR branch, keeping environment files propagated and separated from your main working directory until cleanup.

How do I copy environment files to a new Git worktree automatically?

You can copy environment files to a new Git worktree using a script-driven interface that auto-propagates .env files during creation. This ensures environment consistency and maintains .gitignore hygiene across isolated worktrees.

Do I need Git installed to automate worktree creation and switching?

Yes, Git is a required dependency to automate worktree creation and switching. The management scripts validate inputs, ensure a safe default base branch, and require Git to operate properly within the repository.

What is the best way to clean up multiple Git worktrees after parallel feature development?

The best way to clean up multiple Git worktrees is using a script-driven cleanup command that safely removes isolated branches and their directories. This prevents cluttered setups and risky manual deletion commands in your repository.

Why does my Git worktree environment lack the necessary configuration files?

Git worktree environments often lack configuration files because they are not automatically copied during creation. Using a script-driven interface ensures .env files are auto-copied and .gitignore hygiene is maintained for environment consistency.