git-worktree

Manage Git worktrees for parallel development with environment file copying.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/merlyn-huntress/compound-engineering-plugin-no-mcp --skill git-worktree-merlyn-huntress
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/merlyn-huntress/compound-engineering-plugin-no-mcp/tree/main/plugins/compound-engineering/skills/git-worktree
Command: npx skills add https://github.com/merlyn-huntress/compound-engineering-plugin-no-mcp --skill git-worktree-merlyn-huntress

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill simplifies the management of Git worktrees, providing an isolated environment for parallel development, code reviews, and feature work without the overhead of traditional branching or stashing.

Core Features & Use Cases

  • Create Worktrees: Easily create new worktrees from a specified branch, automatically copying environment files and managing .gitignore.
  • List & Switch: View all active worktrees and seamlessly switch between them.
  • Cleanup: Intelligently remove completed or inactive worktrees.
  • Use Case: When reviewing a Pull Request, if you're not on the target branch, this skill can create an isolated worktree for the PR's branch, allowing you to review code with all necessary environment variables present, without disrupting your current work.

Quick Start

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

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 stashing changes?

Git worktrees provide isolated environments for parallel development, allowing you to work on multiple branches simultaneously. This skill automates worktree creation, switching, and cleanup while copying environment files like .env to ensure your variables persist across branches.

Can I review a pull request without disrupting my current Git branch?

Yes, you can review a pull request by creating an isolated worktree for the PR branch. This skill automatically copies your environment files into the new worktree, allowing you to test the code with all necessary variables without stashing or disrupting your current work.

How does the git-worktree skill handle .env and .gitignore files?

When creating a worktree, the skill automatically copies environment files such as .env and .env.local into the new directory. It also manages your .gitignore file to ensure environment variables are properly ignored and not committed to version control.

What is the best way to list and switch between active Git worktrees?

The best way to list and switch between active worktrees is using an interactive management tool. This skill provides a single bash script to view all active worktrees and seamlessly switch between them following KISS principles for an opinionated, streamlined workflow.

How do I clean up completed or inactive Git worktrees?

You can intelligently remove completed or inactive worktrees using this skill's cleanup feature. It automates the removal process, ensuring your repository stays organized without leaving behind orphaned worktree directories or stale references.

Do I need any special dependencies to use Git worktrees for isolated feature work?

No special dependencies are required to use this skill. It relies on a single bash script for all operations, making it lightweight and easy to integrate into your existing version control workflow without installing additional packages or libraries.