using-git-worktrees

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

1|Updated Aug 27, 2025
One-click install
npx skills add https://github.com/IgorGanapolsky/Random-Timer --skill using-git-worktrees-igorganapolsky
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/IgorGanapolsky/Random-Timer/tree/main/.cursor/skills/using-git-worktrees
Command: npx skills add https://github.com/IgorGanapolsky/Random-Timer --skill using-git-worktrees-igorganapolsky

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, /worktree commands) when available, avoiding phantom state that manual git commands would create. - Safe Fallback Workflow: When no native tool exists, creates a git worktree in a verified gitignored directory (.worktrees/ by default), installs project dependencies, and runs baseline tests. - Use Case: Before implementing a new feature branch, ask the assistant to set up an isolated workspace; it will detect your environment, create the worktree, run npm install or cargo build, and confirm tests pass. ## Quick Start Ask the assistant to set up an isolated worktree workspace before starting implementation of your next feature.

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 with a target path and new branch name, such as git worktree add .worktrees/my-feature -b my-feature. Verify the directory is gitignored first, then install dependencies and run baseline tests before implementing.

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.

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

Prefer a native tool like EnterWorktree or a /worktree command when available, since it manages directory placement, branching, and cleanup automatically. Manual git worktree add is the fallback when no native tool exists.

Why must the worktree directory be in .gitignore?▼

An unignored worktree directory risks committing the entire nested worktree contents into the parent repository. Verify with git check-ignore, and if it is not ignored, add the directory to .gitignore and commit 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. The fallback is to inform the user, work in the current directory instead, and still run dependency setup and baseline tests in place.