using-git-worktrees

Create and verify isolated git worktrees for cross-branch feature work.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps developers start isolated feature work by creating and managing git worktrees, reducing the risk of cross-branch contamination and accidental commits to the main branch.

Core Features & Use Cases

  • Safe project-local and global worktree creation with a defined priority: prefer .worktrees, then worktrees, then CLAUDE.md guidance.
  • Automatic environment preparation and directory validation before switching context.
  • Clear prompts and fallbacks to ask the user when no preferred directory exists, ensuring a smooth setup for new features.

Quick Start

Create and verify a new git worktree for the current project while ensuring it is ignored by the repository's gitignore rules.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I set up git worktrees to isolate feature branches and prevent cross-branch contamination?

To set up git worktrees, create isolated workspaces using directory priority rules that prefer .worktrees, then worktrees, then CLAUDE.md guidance. This prevents cross-branch contamination by maintaining separate directories for simultaneous feature work across branches.

What is the best way to manage multiple git branches simultaneously without accidental commits to main?

Git worktrees provide the best way to manage simultaneous feature work by creating isolated workspaces. They enforce directory validation and verification steps before switching context, preventing accidental commits to the main branch.

Can I create project-local git worktrees or do I need a global directory setup?

You can create both project-local and global git worktrees. The setup enforces directory priority rules, preferring .worktrees, then worktrees, then CLAUDE.md guidance, with fallback prompts to ask the user when no preferred directory exists.

How do I ensure my new git worktree is safely ignored by gitignore rules?

To ensure your new git worktree is safely ignored, the setup process includes automatic environment preparation and directory validation. It verifies the worktree is properly ignored by the repository's gitignore rules before switching context.

Do I need to manually clean up testing environments after using git worktrees?

No, manual cleanup is not required. The git worktree setup process enforces cleanup and testing checks automatically, ensuring safe directory selection and proper environment management after isolated feature work is completed.