using-git-worktrees

Set up an isolated Git worktree and run a clean baseline test suite.

1|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/droxey/skills --skill using-git-worktrees-droxey
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/droxey/skills/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/droxey/skills --skill using-git-worktrees-droxey

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents feature work from contaminating your current workspace by ensuring an isolated directory exists for implementation tasks, using native worktree mechanisms when possible and a safe git-worktree fallback otherwise.

Core Features & Use Cases

  • Workspace isolation detection: Detects whether you are already in a linked worktree (and avoids misclassifying submodules).
  • Native-first worktree creation: Uses platform-native worktree tools when available to avoid unmanaged “phantom” states.
  • Safe git worktree fallback: Creates a new worktree with a clear directory-selection priority and, for project-local directories, verifies the target directory is ignored before creating it.
  • Baseline setup and verification: Runs repo-appropriate dependency install steps and verifies a clean baseline via tests before proceeding.

Quick Start

Use the using-git-worktrees skill to create (or reuse) an isolated worktree, run baseline setup, and confirm tests pass before starting your feature implementation.

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 work from my current Git workspace?

Git worktrees create an isolated directory for feature work, preventing modifications from contaminating your current workspace. This approach uses native worktree tools or a safe fallback to separate implementation tasks and run tests without impacting the main repository state.

Why should I use a Git worktree instead of cloning a new repository for feature work?

Git worktrees share the same repository history without duplicating data, making them more efficient than cloning. They provide workspace isolation for feature development and testing while maintaining a single source of truth for your codebase.

How do I set up a Git worktree and verify tests pass before starting implementation?

Setting up a Git worktree involves creating an isolated directory, running dependency installation steps, and executing a clean baseline test suite. This verifies the environment is functional before proceeding with feature implementation.

Can I use Git worktrees if my project doesn't support native worktree tools?

Yes, a safe Git worktree fallback mechanism creates an isolated workspace when native tools are unavailable. It selects a directory based on clear priority rules and verifies project-local paths are ignored before creation.

What happens if I'm already working inside a linked Git worktree?

The workspace isolation detection mechanism identifies existing linked worktrees and avoids misclassifying submodules. It recognizes when you are already in an isolated environment and prevents creating unnecessary duplicate worktrees.

How do I ensure project-local Git worktree directories don't cause repository conflicts?

For project-local directories, the Git worktree creation process verifies the target path is properly ignored before generating the worktree. This precaution prevents untracked directories from polluting the repository status and causing conflicts.