git-worktree

Manage Git worktrees for parallel development with branch safety checks.

267|70|Updated Nov 1, 2025
One-click install
npx skills add https://github.com/codemie-ai/codemie-code --skill git-worktree-codemie-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/codemie-ai/codemie-code/tree/main/.claude/skills/codemie-worktree
Command: npx skills add https://github.com/codemie-ai/codemie-code --skill git-worktree-codemie-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers manage Git worktrees to enable parallel development without cluttering the main repository.

Core Features & Use Cases

  • Proactive branch protection: Always check the current branch and offer to create a feature worktree to prevent commits to main.
  • Lifecycle management: List, create, switch, move, prune, lock/unlock worktrees to organize parallel work.
  • Parallel development workflows: Enable multiple branches to be worked on simultaneously without interfering with the main line.

Quick Start

  • Check your current branch: git branch --show-current
  • List existing worktrees: git worktree list
  • Create and switch to a feature worktree (from main): git worktree add -b feat/new-feature ../myrepo-wt-feat-new-feature main
  • Change directory to the new worktree: cd ../myrepo-wt-feat-new-feature
  • Start implementing the feature

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 the main repository?

Git worktrees let you manage parallel development by creating isolated working directories for different branches. This Skill automates worktree lifecycle management to enable simultaneous branch work without interfering with the main line.

How do I prevent accidental commits to main while working on a feature branch?

Preventing accidental commits to main requires a pre-check workflow on your current branch. This Skill proactively checks your active branch and offers to create a feature worktree, ensuring safety checks before you start implementing changes.

What is the best way to create and switch to a new Git worktree from the main branch?

Creating a new Git worktree involves using `git worktree add -b feat/new-feature ../myrepo-wt-feat-new-feature main`, then changing directory to the new worktree. This Skill provides explicit commands and prompts to guide the creation and switching process.

Can I list, move, and prune multiple Git worktrees during a workflow?

Yes, Git worktree lifecycle management includes listing, moving, pruning, and removing worktrees. This Skill supports these workflows to organize parallel work and provides automated guidance for each operational step.

Does this Git worktree workflow require any special dependencies or components?

No, this Git worktree workflow requires no special dependencies or components. It operates using standard Git commands and enforces safety checks through explicit prompts without needing external tools.