using-git-worktrees

Create isolated git worktrees with automatic safety checks and setup.

58|6|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/Matt-Aurora-Ventures/Jarvis --skill using-git-worktrees-matt-aurora-ventures
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Matt-Aurora-Ventures/Jarvis/tree/main/.windsurf/skills/using-git-worktrees
Command: npx skills add https://github.com/Matt-Aurora-Ventures/Jarvis --skill using-git-worktrees-matt-aurora-ventures

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When starting feature work, teams need a safe, isolated environment to avoid contaminating the main workspace. This skill creates isolated git worktrees with robust directory selection and safety verification to keep work isolated until implementation is ready.

Core Features & Use Cases

  • Directory selection priority: prefers .worktrees, then worktrees, then CLAUDE.md preferences, and finally prompts the user when no guidance exists.
  • Safety verification: checks that project-local worktrees are ignored by git, and updates .gitignore as needed with a commit when necessary.
  • Automatic setup: detects project name, creates a new worktree on a new branch, and runs project-specific setup (npm, cargo, pip, etc.) to establish a clean baseline.
  • Use Case: ideal for feature development, experiments, or refactors requiring isolated workspaces without switching branches.

Quick Start

Create an isolated git worktree for the current project with automatic ignore verification and setup.

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 in git without switching branches?

Git worktrees create isolated workspaces from your main repository, allowing you to develop features, experiments, or refactors in separate directories without contaminating the primary working directory.

How do I set up a git worktree for a new feature branch?

Creating a git worktree involves automatically detecting the project name, creating a new branch, running language-specific setup like npm or cargo, and validating a clean baseline before starting work.

How does git worktree handle directory selection and .gitignore safety?

Worktree directory selection prefers .worktrees, then worktrees, then CLAUDE.md preferences, and verifies safety by checking that local worktrees are ignored in .gitignore, updating it with a commit if necessary.

Can I use git worktrees for large refactoring across multiple branches?

Yes, git worktrees are ideal for refactoring requiring isolated workspaces, ensuring safety checks and automatic setup establish clean baselines across multiple branches without switching contexts.

What is the best way to manage isolated git workspaces for experiments?

Using git worktrees provides safe isolation for experimental work by applying directory discovery, running project-specific setup, and validating a clean baseline to keep experiments separate from the main branch.

When should I not use git worktrees for branch isolation?

You should avoid git worktrees if your project lacks clear directory selection preferences or if automatic .gitignore updates and commit management conflict with your team's repository safety constraints.