Git Worktree Manager

Create Git worktrees with deterministic ports and environment file sync.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/amanhsn/flyerbuild --skill git-worktree-manager-amanhsn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git Worktree Manager
Source: https://github.com/amanhsn/flyerbuild/tree/main/.cursor/skills/git-worktree-manager
Command: npx skills add https://github.com/amanhsn/flyerbuild --skill git-worktree-manager-amanhsn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of managing multiple Git worktrees, ensuring isolated development environments with consistent port allocation, environment synchronization, and safe cleanup procedures.

Core Features & Use Cases

  • Worktree Creation: Create new worktrees from branches, optionally creating the branch if it doesn't exist.
  • Port Allocation: Assigns deterministic, non-conflicting ports for services like databases and applications per worktree.
  • Environment Sync: Copies .env* files from the main repository to new worktrees.
  • Dependency Installation: Optionally installs project dependencies based on lockfile detection.
  • Safe Cleanup: Identifies and optionally removes stale, merged, and clean worktrees with safety checks.
  • Use Case: When working on multiple features simultaneously, this skill allows you to create isolated environments for each feature branch, preventing port conflicts and ensuring each environment is correctly set up without manual intervention.

Quick Start

Use the Git Worktree Manager skill to create a new worktree for the branch 'feature/new-ui' named 'wt-new-ui', installing dependencies.

Frequently Asked Questions about Git Worktree Manager

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

FAQPage Schema
How do I set up Git worktrees for parallel branch development without port conflicts?

Git worktree management automates the creation of isolated development environments for parallel branch development. It standardizes setup by synchronizing environment files and assigning deterministic, non-conflicting ports per worktree to prevent service collisions.

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

To copy .env files to a new Git worktree automatically, the environment synchronization feature replicates .env* files from the main repository into the new worktree during creation. This ensures each isolated branch has the correct configuration.

Can I automatically install project dependencies when creating a Git worktree?

Yes, you can automatically install project dependencies when creating a Git worktree. The setup process detects lockfiles in the repository and optionally installs dependencies to prepare the isolated development environment immediately.

Does Git worktree management require specific command-line tools?

Yes, Git worktree management requires Git command-line tools for repository operations. You must have Git installed in your environment to execute the branch creation, isolation, and cleanup processes required for parallel development.

What is the best way to clean up stale or merged Git worktrees safely?

The best way to clean up stale or merged Git worktrees safely is to use a management tool with built-in safety checks. It identifies clean, merged, and stale worktrees, allowing optional removal to prevent accidental data loss.