using-git-worktrees

Creates isolated git worktrees for feature work with verified ignore rules and project setup.

Updated Feb 11, 2016
One-click install
npx skills add https://github.com/Ehrax/dotfiles --skill using-git-worktrees-ehrax
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Ehrax/dotfiles/tree/main/configs/agents/skills/using-git-worktrees
Command: npx skills add https://github.com/Ehrax/dotfiles --skill using-git-worktrees-ehrax

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers start feature work in isolated git worktrees to prevent changes from leaking into the main workspace. It selects appropriate worktree locations, applies smart directory preferences from CLAUDE.md when available, and enforces safety checks before creation.

Core Features & Use Cases

  • Isolated workspaces: creates dedicated worktree directories to keep feature work separate from the main project.
  • Safe directory selection: follows a priority order (existing directories, CLAUDE.md preferences, user prompts) for the target location.
  • Safety verification: validates ignore rules and ensures worktrees are not committed accidentally, with guidance to fix ignores when needed.
  • Auto-setup: detects project structure (e.g., Node, Rust, Python) and runs initial setup to establish a clean baseline.

Quick Start

Create an isolated git worktree for a feature and verify it is ignored before you start coding.

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 in a git worktree without affecting my main workspace?

Git worktrees create isolated directories for branching work, preventing changes from leaking into the main project workspace. This skill safely sets up these dedicated worktrees by selecting appropriate locations and verifying ignore rules before creation.

How do I stop git worktrees from being accidentally committed to my repository?

To prevent git worktrees from being committed accidentally, this skill validates Git ignore rules before creation. It verifies your ignore configuration and provides guidance to fix ignores when needed, ensuring worktrees remain safely excluded from version control.

How do I set up a clean baseline when creating a git worktree for a new feature?

Creating a git worktree with a clean baseline involves detecting the project structure and running initial setup commands. This skill automatically identifies Node, Rust, or Python projects and executes the appropriate setup to establish a ready-to-code environment.

Can I configure custom directory locations for git worktrees using CLAUDE.md?

Git worktrees can use custom directory locations configured in CLAUDE.md. This skill follows a priority order for safe directory selection, preferring existing directories, then CLAUDE.md preferences, and finally prompting the user for a target location.

Does this git worktree workflow support both project-local and global worktree locations?

Git worktree workflows support both project-local and global worktree locations. This skill works with either preference, selecting the appropriate target path based on existing directories or your CLAUDE.md configuration to ensure safe workspace isolation.