using-git-worktrees

Creates isolated git worktree workspaces with native tool detection and baseline test verification.

10|1|Updated Jul 29, 2026
One-click install
npx skills add https://github.com/flowing-abyss/obsidian-local-fonts --skill using-git-worktrees-flowing-abyss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/flowing-abyss/obsidian-local-fonts/tree/main/.ai/skills/using-git-worktrees
Command: npx skills add https://github.com/flowing-abyss/obsidian-local-fonts --skill using-git-worktrees-flowing-abyss

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 implementation task begins in an isolated workspace, detecting existing isolation first and falling back to manual git worktrees only when no native tool exists. ## Core Features & Use Cases - Isolation Detection: Runs git rev-parse checks to determine whether you are already in a linked worktree, a submodule, or a normal checkout before creating anything. - Native Tool Preference: Uses platform-native worktree tools (e.g., EnterWorktree) when available, falling back to git worktree add only when necessary. - Safe Directory Handling: Selects .worktrees/ or worktrees/ directories, verifies they are git-ignored, and commits the ignore rule before proceeding. - Use Case: Before implementing a new feature, the Skill sets up a worktree, installs dependencies for Node, Rust, Python, or Go projects, and runs baseline tests so you start from a verified clean state. ## Quick Start Ask the assistant to set up an isolated worktree for your next feature branch and verify the project tests pass before writing any code.

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 to 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, which produces the same difference.

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

Use a native tool such as EnterWorktree or a /worktree command whenever one is available, since it manages directory placement, branching, and cleanup automatically. Manual `git worktree add` is only a fallback and can create state the harness cannot track.

Why must the worktrees directory be in gitignore?

An unignored worktree directory causes git to track the entire nested worktree contents, accidentally committing them into the repository. Verify with `git check-ignore` and commit the .gitignore update before creating the worktree.

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 restriction and continue working in the current directory, running dependency setup and baseline tests in place instead.