@tank/git-worktrees

Manage the complete lifecycle of Git worktrees, including creation, inspection, removal, and repair.

1|1|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/tankpkg/skills --skill tank-git-worktrees
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: @tank/git-worktrees
Source: https://github.com/tankpkg/skills/tree/main/skills/git-worktrees
Command: npx skills add https://github.com/tankpkg/skills --skill tank-git-worktrees

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the management of Git worktrees, preventing sprawl and ensuring efficient parallel development workflows.

Core Features & Use Cases

  • Lifecycle Management: Create, work in, resolve, and clean up Git worktrees.
  • Workflow Support: Handles common scenarios like hotfixes, PR reviews, and parallel development.
  • Use Case: You're working on a new feature and need to quickly address a production bug. Use this Skill to create a separate worktree for the hotfix without disrupting your current work, then clean it up once merged.

Quick Start

Use the git worktrees skill to add a new worktree for the 'hotfix/issue-123' branch in the '../myproject-hotfix' directory.

Frequently Asked Questions about @tank/git-worktrees

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

FAQPage Schema
What is the best way to manage a git worktree lifecycle including creation and removal?

Managing a git worktree lifecycle involves creating, inspecting, moving, and ultimately removing or pruning the worktree. Proper lifecycle management prevents directory sprawl and ensures efficient parallel development workflows.

Does git worktree work with bare repositories for CI/CD integration?

Yes, git worktree supports advanced patterns like bare repository setups. This configuration is particularly useful for CI/CD integration and multi-agent development isolation by allowing multiple worktrees to share a single Git directory.

Why does my git worktree cleanup leave stale directories and how do I prune them?

Stale directories remain when worktrees are deleted manually without Git's knowledge. You can prune these stale worktree references to clean up your repository metadata and resolve common worktree operation pitfalls.

Can I move an existing git worktree to a different directory path?

Yes, you can move a git worktree to a new directory path. This action updates the worktree's registered location within the Git repository while preserving your current working state and branch history.

How do I lock a git worktree to prevent automatic pruning during parallel development?

You can lock a git worktree to prevent it from being automatically pruned. This is useful for parallel development scenarios where a worktree might be temporarily inaccessible but still needs to be retained.