git-worktree-manager

Automate Git worktree creation, port configuration, and cleanup for parallel branches.

Updated Nov 3, 2016
One-click install
npx skills add https://github.com/xleliberty/mydotfiles --skill git-worktree-manager-xleliberty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree-manager
Source: https://github.com/xleliberty/mydotfiles/tree/main/.config/.claude/plugins/cache/claude-code-skills/engineering-advanced-skills/2.1.2/git-worktree-manager
Command: npx skills add https://github.com/xleliberty/mydotfiles --skill git-worktree-manager-xleliberty

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill solves the friction of context switching and port collisions when managing multiple concurrent feature branches, hotfixes, and experimental tasks in a single repository.

Core Features & Use Cases

  • Isolated Environments: Automatically creates and prepares Git worktrees with unique port allocations and environment variable synchronization.
  • Safe Cleanup: Provides intelligent, safety-checked removal of stale or merged worktrees to keep your local workspace clean.
  • Use Case: When you need to work on a critical hotfix while your current feature branch is in a dirty, uncommitted state, this skill allows you to spin up a fresh, isolated worktree in seconds without disrupting your existing progress.

Quick Start

Use the git-worktree-manager skill to create a new worktree named wt-feature-alpha for the branch feature/alpha based on the main branch.

Frequently Asked Questions about git-worktree-manager

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

FAQPage Schema
How do I manage Git worktrees for parallel branch development without port collisions?

Git worktree management automates creating isolated environments with unique port allocations and environment variable synchronization to prevent local service conflicts during parallel branch development.

Can I create a Git worktree for a hotfix without disrupting my current uncommitted changes?

Yes, creating a Git worktree allows you to spin up a fresh, isolated working directory in seconds without disrupting existing uncommitted progress in your main repository. This enables safe context switching for critical hotfixes.

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

The best way to clean up stale Git worktrees is using intelligent, safety-checked removal scripts that verify merge status before deletion, ensuring your local workspace remains clean without risking data loss. This prevents accidental removal of active branches.

Do I need Python 3 and Git CLI to automate worktree creation and environment configuration?

Yes, you need standard Git CLI and Python 3 installed to execute the deterministic management scripts that automate worktree creation, port configuration, and environment variable synchronization. These dependencies are required for the automation scripts to run.

Does Git worktree automation support multi-agent workflows with isolated environment variables?

Yes, Git worktree automation supports multi-agent workflows by ensuring isolated environment variables and non-conflicting local service ports across multiple concurrent worktrees. This allows parallel development agents to operate without interference.

Why use Git worktrees instead of cloning repositories multiple times for parallel development?

Git worktrees share the same repository history without duplicating the entire clone, providing isolated working directories with automated port configuration and environment synchronization. This saves disk space and simplifies branch management compared to multiple clones.