using-git-worktrees

Creates isolated git worktree workspaces with detection, setup, and baseline test verification.

1|Updated Sep 13, 2026
One-click install
npx skills add https://github.com/silentFellow/public-dotfiles --skill using-git-worktrees-silentfellow
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/silentFellow/public-dotfiles/tree/main/agents/skills/using-git-worktrees
Command: npx skills add https://github.com/silentFellow/public-dotfiles --skill using-git-worktrees-silentfellow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting feature work directly in your main checkout risks polluting your current branch and mixing unrelated changes. This Skill ensures every piece of work happens in an isolated workspace by detecting existing isolation, preferring native worktree tools, and falling back to manual git worktrees only when needed. ## Core Features & Use Cases - Isolation Detection: Checks whether you are already inside a linked worktree or a submodule before creating anything, avoiding duplicate or phantom worktrees. - Native Tool Preference with Git Fallback: Uses platform-native worktree tools (e.g., EnterWorktree) when available, otherwise creates a worktree with git worktree add in a verified, git-ignored directory. - Project Setup and Baseline Verification: Auto-detects Node.js, Rust, Python, or Go projects, installs dependencies, and runs the test suite to confirm a clean baseline before implementation begins. - Use Case: Before implementing a new feature, ask the assistant to set up an isolated workspace; it will create .worktrees/my-feature, install dependencies, run tests, and report readiness. ## Quick Start Ask the assistant to set up an isolated git worktree for your new feature and verify the project tests pass 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 create an isolated git worktree for feature development?▼

Run `git worktree add <path> -b <branch-name>` to create a linked worktree on a new branch. Prefer placing it in a `.worktrees/` directory at the project root, and verify that directory is listed in .gitignore before creating it.

How do I check if I am already inside a git worktree?▼

Compare `git rev-parse --git-dir` with `git rev-parse --git-common-dir`. If the resolved paths differ, you are in a linked worktree; also run `git rev-parse --show-superproject-working-tree` to rule out being inside a submodule.

Should I use git worktree add or a native worktree tool?▼

Use a native worktree tool (such as EnterWorktree or a /worktree command) whenever one is available, since it manages placement, branching, and cleanup. Only fall back to manual `git worktree add` when no native tool exists.

Why must the worktree directory be in .gitignore?▼

An unignored worktree directory risks committing the entire worktree contents into the repository. Verify with `git check-ignore` before creation, and add the directory to .gitignore and commit that change if it is not ignored.

What happens if git worktree add fails with a permission error?▼

A permission error usually means the sandbox blocked worktree creation. In that case, report the sandbox denial and continue working in the current directory, running dependency setup and baseline tests in place.