using-git-worktrees

Create isolated git worktrees with directory and safety validation.

Updated Sep 7, 2025
One-click install
npx skills add https://github.com/vijaykpatel/Rajat-Mahotsav-Website --skill using-git-worktrees-vijaykpatel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/vijaykpatel/Rajat-Mahotsav-Website/tree/main/.cursor/skills/using-git-worktrees
Command: npx skills add https://github.com/vijaykpatel/Rajat-Mahotsav-Website --skill using-git-worktrees-vijaykpatel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Isolating feature work from the main workspace by creating dedicated git worktrees that share the repository, reducing risk to the primary branch.

Core Features & Use Cases

  • Directory priority: prefer existing local worktrees (.worktrees or worktrees), then CLAUDE.md preferences, then user prompts.
  • Safety verification: ensures the selected worktree directory is ignored by git before creation and automatically fixes ignore rules if needed.
  • Automatic setup: auto-detects project tooling (Node, Rust, Python, Go) and runs appropriate install/build steps in the new worktree.
  • Flexible placements: supports project-local directories and a global location while keeping changes isolated from main development.

Quick Start

Create an isolated git worktree for your new feature, selecting the directory per policy and validating ignore rules before proceeding.

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 isolated git worktrees for feature work?

To create isolated git worktrees, you can automate the process by selecting a directory based on existing folders, CLAUDE.md preferences, or user prompts, while verifying the location is ignored by git.

What is the safest way to set up a git worktree directory?

The safest way to set up a git worktree directory is to use safety verification that ensures the selected location is ignored by git before creation, automatically fixing ignore rules if needed to keep changes isolated.

Can I auto-detect project tooling when creating git worktrees?

Yes, you can auto-detect project tooling like Node, Rust, Python, or Go when creating git worktrees, automatically running the appropriate install and build steps in the new worktree to prepare the environment.

How do I configure git worktree directory preferences?

You can configure git worktree directory preferences by defining them in CLAUDE.md, which the workflow checks after looking for existing local worktree directories like .worktrees or worktrees.

Does git worktree workflow validate a clean baseline before starting feature work?

Yes, the git worktree workflow validates a clean baseline before starting feature work, ensuring the primary branch is stable before creating an isolated workspace for new development.

Can I use a global location for git worktrees instead of project-local directories?

Yes, you can use a global location for git worktrees instead of project-local directories, keeping changes fully isolated from your main development workspace while sharing the same repository.