using-git-worktrees

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

3|1|Updated May 29, 2026
One-click install
npx skills add https://github.com/mambo-wang/CodingHub --skill using-git-worktrees-mambo-wang
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/mambo-wang/CodingHub/tree/main/.qoder/skills/using-git-worktrees
Command: npx skills add https://github.com/mambo-wang/CodingHub --skill using-git-worktrees-mambo-wang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Feature development directly in your main working directory risks polluting your current branch, mixing unrelated changes, and losing track of experimental work. This Skill establishes an isolated workspace before any implementation begins, so your main checkout stays untouched. ## Core Features & Use Cases - Isolation Detection: Checks whether you are already inside a linked worktree or a git submodule before creating anything, preventing nested or duplicate worktrees. - Native Tool Priority with Git Fallback: Uses platform-native worktree tools (e.g., EnterWorktree) when available, and falls back to manual git worktree add only when no native tool exists. - Safe Directory Selection: Follows a priority order for worktree placement (existing .worktrees/, worktrees/, global config path, or default) and verifies the directory is git-ignored before creation. - 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 work starts. - Use Case: Before implementing a new feature requested in a plan, run this Skill to spin up an isolated worktree on a new branch, install dependencies, and confirm all existing tests pass. ## Quick Start Ask the AI to set up an isolated git worktree for the new feature branch 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?▼

First check whether you are already inside a linked worktree by comparing git rev-parse --git-dir and --git-common-dir. If not, use a native worktree tool if available, otherwise run git worktree add with a new branch in a git-ignored directory like .worktrees/.

What is the difference between git worktree and git branch for isolation?▼

A git branch only switches the current checkout, while git worktree creates a separate working directory linked to the same repository. Worktrees let you work on multiple branches simultaneously without stashing or switching.

Why does git worktree detection fail inside a submodule?▼

Inside a submodule, git-dir and git-common-dir also differ, which mimics a worktree. Run git rev-parse --show-superproject-working-tree first; if it returns a path, you are in a submodule and should treat it as a normal repository.

Should the worktrees directory be added to gitignore?▼

Yes, project-local worktree directories like .worktrees/ must be ignored before creation. Verify with git check-ignore, and if not ignored, add the entry to .gitignore and commit it to prevent worktree contents from polluting git status.

What happens if baseline tests fail in a new worktree?▼

The Skill reports the failures and asks whether to continue or investigate before proceeding. This ensures pre-existing breakage is not confused with bugs introduced by the new feature work.