using-git-worktrees

Creates isolated Git worktrees for feature development with dependency setup and baseline tests.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents accidental changes to your current branch by ensuring you create and use an isolated workspace when starting feature work.

Core Features & Use Cases

  • Detects existing isolation: Identifies whether you are already in a linked worktree or in a submodule so you don’t create nested or duplicate worktrees.
  • Uses native worktree tooling when available: Prefers platform-native worktree creation to avoid phantom state that the harness can’t manage.
  • Falls back to safe git worktree creation: Chooses an appropriate directory using a clear priority order and verifies project-local worktree directories are ignored before creating them, then runs setup and baseline tests.
  • Use Case: You want to implement a risky refactor or a new feature without touching the currently checked-out branch; create an isolated worktree, install dependencies, and confirm a clean test baseline before coding.

Quick Start

Use the using-git-worktrees skill to create (or reuse) an isolated git worktree, set up the project dependencies, and verify a clean test baseline before starting 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 work in git to protect my current branch from unintended changes?

To isolate feature work in git, you can create a project-local git worktree that provides a separate directory for your branch. This ensures your current checked-out branch remains untouched while you implement changes safely.

What is a git worktree and when do I need to use one?

A git worktree is a mechanism that links multiple working directories to a single repository. You need to use one when starting new work or risky refactors, allowing you to verify a clean test baseline without altering your primary branch state.

How do I set up an isolated git workspace with dependency installation and baseline tests?

Setting up an isolated git workspace involves safely creating a worktree, verifying the directory is ignored, and then running auto-setup scripts. This process installs project dependencies and verifies a clean test baseline before you begin coding.

Can I create nested git worktrees if I am already working inside a submodule?

No, you should not create nested worktrees inside submodules. The workspace isolation process detects existing isolation and submodules to prevent duplicate or nested worktree creation, ensuring native tooling manages repository state correctly.

Does git worktree creation verify that the new directory is properly ignored?

Yes, git worktree creation verifies that project-local worktree directories are properly ignored before creation. This ignore verification prevents phantom state and ensures the harness can manage the isolated workspace without conflicts.

What is the best way to manage workspace isolation before executing an implementation plan?

The best way to manage workspace isolation before executing an implementation plan is using native git worktree tooling. It prefers platform-native worktree creation, safely isolating the feature work and confirming a clean baseline to avoid unintended branch changes.