using-git-worktrees

Coordinate parallel development work across multiple git branches without checkout conflicts.

383|15|Updated Oct 19, 2026
Ready to run
npx skills add https://github.com/Innei/ryugi --skill using-git-worktrees-innei
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Innei/ryugi/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/Innei/ryugi --skill using-git-worktrees-innei

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When multiple developers work in the same repository or you need to switch contexts between branches without losing uncommitted changes, git worktrees create isolated working directories linked to the same repository. This Skill eliminates the friction of stashing, switching, and re-applying changes across branch contexts. ## Core Features & Use Cases - Parallel Branch Development: Work on multiple branches simultaneously without switching back and forth in a single checkout. - Conflict Avoidance: Keep your uncommitted work isolated when other developers are making edits in the shared repository. - Spec-to-Implementation Handoff: Move work between branches cleanly when specs or test-driven development require a fresh branch context. - Use Case: You are implementing a feature on main when a critical bugfix needs to land on a release branch. Create a worktree for the bugfix, commit and push it, then return to your feature work without merge conflicts or manual state management. ## Quick Start Before making your first edit, run the where-to-work diagnostic commands to determine whether you should develop in the current checkout or create a new worktree for your task.

Frequently Asked Questions about using-git-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When should I use a git worktree instead of switching branches?▼

Create a worktree when another developer has uncommitted edits in the checkout, when your work depends on a different branch base than HEAD, or when an EXPLORING file marks your work path. Otherwise, commit your changes and switch in place to avoid the overhead of worktree setup and dependency reinstalls.

How do I move uncommitted changes to a different branch?▼

Use git stash push with your file paths to move changes without switching branches in a shared checkout. Then create a worktree, run git stash pop, and verify the original checkout is clean. Only use this when other developers have edits in the shared repository.

What files should I never commit when working in a shared checkout?▼

Never commit build caches (.vitest/, .next/, dist/), node_modules, or untracked dependencies. Stage only the source files you changed using git diff patches, not git add -A or git add . which capture unrelated edits or build artifacts.

How do I clean up a worktree after my work lands?▼

Remove worktrees from the main repository root using git worktree remove, then run git worktree prune. Use native tools (EnterWorktree, archive tools) if available instead of git worktree add to ensure proper harness cleanup.

What happens if git worktree removal is refused?▼

The worktree contains files that exist nowhere else. Never force-remove; instead show your human partner the status output and ask whether to commit those files, move them to the main repo, or delete them permanently.

Can I use a worktree if I have uncommitted changes in the main checkout?▼

Yes, if the changes do not affect the files your worktree work touches. Stage only your hunks by applying git diff patches with git apply --cached to avoid committing someone else's edits. If your paths overlap with other edits, move your changes via stash instead.