git-worktrees

Manage isolated Git worktrees for multi-branch feature development.

3|1|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/jagreehal/jagreehal-claude-skills --skill git-worktrees-jagreehal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktrees
Source: https://github.com/jagreehal/jagreehal-claude-skills/tree/main/skills/git-worktrees
Command: npx skills add https://github.com/jagreehal/jagreehal-claude-skills --skill git-worktrees-jagreehal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees create isolated workspaces sharing the same repository, enabling concurrent feature work across branches without mutating the main working directory.

Core Features & Use Cases

  • Directory priority and safety: detect existing local worktree folders, verify they are ignored, and prevent accidental commits of worktree contents.
  • Guided creation and cleanup: automatically create a new worktree, switch context to the feature branch, and remove it when done.
  • Baseline readiness: ensure a clean starting point by running project setup and baseline tests before starting work.

Quick Start

Start by identifying or creating a dedicated worktree directory, then add a new feature branch and switch to it:

  • Check for a preferred worktree location (.worktrees or worktrees)
  • If absent, prompt for a location and proceed with git worktree add -b <branch> <path>
  • After work is complete, remove the worktree with git worktree remove <path> and delete the feature branch if merged.

Frequently Asked Questions about git-worktrees

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

FAQPage Schema
How do I use git worktrees for isolated multi-branch feature development?

Git worktrees enable isolated multi-branch feature development by creating separate workspaces sharing the same repository. You can use guided commands to add a new worktree, switch to a feature branch, and safely remove it after merging to prevent accidental commits.

How does a git worktree manage directory priority and safety?

Git worktree management ensures safety by detecting existing local worktree folders like .worktrees and verifying they are ignored. This prevents accidental commits of worktree contents into the main repository during multi-branch workflows.

What is the best way to set up baseline testing before starting work in a new git worktree?

The best way to ensure baseline readiness is running project setup and baseline tests immediately after creating a new git worktree. This provides a clean starting point and validates the isolated workspace before feature development begins.

Can I switch contexts between feature branches without mutating the main working directory?

Yes, git worktrees allow you to switch contexts between feature branches without mutating the main working directory. They create isolated workspaces sharing the repository, enabling concurrent feature work across different local directories safely.

How do I remove a git worktree and delete the feature branch after merging?

To remove a git worktree after work is complete, use standard git worktree remove commands targeting the specific path. After confirming the feature branch is merged, you can safely delete it to clean up the isolated workspace.