using-git-worktrees

Create isolated Git worktrees with ignore validation and setup commands.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/beyondwen/track-record-new --skill using-git-worktrees-beyondwen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/beyondwen/track-record-new/tree/main/.gemini/skills/using-git-worktrees
Command: npx skills add https://github.com/beyondwen/track-record-new --skill using-git-worktrees-beyondwen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Isolate feature development by creating a dedicated Git worktree so the primary workspace remains stable while you work on a separate branch.

Core Features & Use Cases

  • Directory discovery: prefer .worktrees, then worktrees, with CLAUDE.md as a fallback hint.
  • Safety validation: ensure worktree directories are ignored via gitignore before creation.
  • Guided workflow: automatically choose location based on priority and prompt when no preference is found.
  • Environment setup: run per-project setup commands after creating the worktree to ready the environment.

Quick Start

Create an isolated Git worktree for a feature, verify ignore rules, and set up the project environment.

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 development from my main Git workspace?

To isolate feature development, create a dedicated Git worktree to manage a separate branch in an isolated directory. This keeps your primary workspace stable while allowing you to work on features independently without switching branches.

How does Git worktree directory discovery and ignore validation work?

Directory discovery prefers `.worktrees`, then `worktrees`, using `CLAUDE.md` as a fallback. Ignore validation checks `.gitignore` to ensure worktree directories are ignored before creation, preventing accidental commits of nested working directories.

Can I run project setup commands automatically after creating a Git worktree?

Yes, after creating a Git worktree, the workflow runs per-project setup commands to ready the environment. This automates environment preparation, ensuring the isolated branch has all dependencies configured immediately.

What is the best way to manage multiple Git branches without stashing current work?

Using Git worktrees is the best way to manage multiple branches without stashing. Worktrees provide isolated directories for each branch, allowing simultaneous branch work without disrupting your primary workspace or stashing uncommitted changes.

What happens if no preferred directory is found for Git worktree creation?

If no preferred directory is found during worktree creation, the guided workflow prompts you to choose a location. It enforces a discovery order based on priority and interactively asks for input when no configuration preference exists.