using-git-worktrees

Creates isolated git worktrees with directory selection, ignore verification, and baseline test validation.

2|Updated Aug 15, 2025
One-click install
npx skills add https://github.com/Grupo-6-ADS-B/FittNutri --skill using-git-worktrees-grupo-6-ads-b
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Grupo-6-ADS-B/FittNutri/tree/main/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/Grupo-6-ADS-B/FittNutri --skill using-git-worktrees-grupo-6-ads-b

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on multiple branches simultaneously often requires stashing changes or cloning the repository again, which disrupts your current workspace and wastes disk space. This Skill sets up isolated git worktrees so you can develop features in parallel without touching your main checkout. ## Core Features & Use Cases - Smart Directory Selection: Follows a priority order (existing .worktrees/ or worktrees/ directories, then CLAUDE.md preferences, then user prompt) to pick a consistent worktree location. - Safety Verification: Checks with git check-ignore that project-local worktree directories are gitignored before creation, and fixes the .gitignore automatically if not. - Automated Setup and Baseline Validation: Auto-detects project type (Node.js, Rust, Python, Go), installs dependencies, and runs the test suite to confirm a clean baseline before work begins. - Use Case: Before implementing a new authentication feature, create an isolated worktree at .worktrees/auth on a new branch, install dependencies, and verify all 47 existing tests pass so new bugs are distinguishable from pre-existing failures. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the project tests pass before I start implementing.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I create a git worktree for a new feature branch?

Run git worktree add with a target path and the -b flag to create a new branch, for example git worktree add .worktrees/auth -b feature/auth. Then change into that directory and install project dependencies before starting work.

Where should git worktrees be stored in a project?

Prefer an existing .worktrees or worktrees directory in the project, with .worktrees taking priority if both exist. If neither exists, check CLAUDE.md for a stated preference, otherwise ask the user or use a global location outside the repository.

Do git worktree directories need to be in .gitignore?

Yes, project-local worktree directories like .worktrees must be ignored, otherwise their contents pollute git status and risk being committed. Verify with git check-ignore and add the entry to .gitignore before creating the worktree.

Why run tests immediately after creating a worktree?

Running the test suite establishes a clean baseline so you can distinguish new bugs from pre-existing failures. If tests fail at baseline, report the failures and get explicit confirmation before proceeding with implementation.

Can git worktrees be used with Node.js, Rust, Python, or Go projects?

Yes, worktrees are language-agnostic since they are a git feature. After creation, auto-detect the project type from files like package.json, Cargo.toml, requirements.txt, or go.mod and run the matching install and test commands.