using-git-worktrees

Create isolated Git worktrees with directory selection and safety verification.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you create isolated Git worktrees for feature development, ensuring a clean and separate workspace without interfering with your main branch.

Core Features & Use Cases

  • Isolated Workspaces: Create separate directories for different branches, sharing the same repository.
  • Smart Directory Selection: Prioritizes .worktrees/, then worktrees/, then checks CLAUDE.md for preferences, or prompts the user.
  • Safety Verification: Ensures project-local directories are ignored by Git before creating a worktree to prevent accidental commits.
  • Automated Setup: Detects and runs project setup commands (npm, cargo, pip, poetry, go) and verifies a clean baseline with tests.
  • Use Case: When starting a new feature, use this Skill to set up a dedicated worktree, install dependencies, and confirm tests pass before you begin coding.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace for the 'feature/new-login' branch.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I isolate feature work with git worktrees to avoid branch context switching?

To isolate feature work with git worktrees, you create separate directories for different branches that share the same repository. This provides a clean workspace for parallel development without interfering with your main branch.

What is the best way to set up a new git worktree for feature development?

The best way to set up a git worktree is using automated directory selection that prioritizes `.worktrees/` or `worktrees/`, verifies safety by ignoring project-local directories in Git, and automatically runs setup commands like npm or cargo to confirm a clean baseline.

How does git worktree directory selection work to prevent accidental commits?

Git worktree directory selection works by prioritizing `.worktrees/`, then `worktrees/`, then checking `CLAUDE.md` for preferences. Safety verification ensures these project-local directories are ignored by Git before creating a worktree to prevent accidental commits.

Can I automate dependency installation and test verification when creating a git worktree?

Yes, you can automate dependency installation and baseline test verification when creating a git worktree. The setup detects and runs project setup commands like npm, cargo, pip, poetry, or go, and verifies tests pass before you begin coding.

Why should I use git worktrees for parallel branch development instead of stashing changes?

You should use git worktrees for parallel branch development because they provide reliable isolation by creating separate directories for different branches. This avoids the overhead of stashing changes and allows simultaneous work on multiple features without context switching.