using-git-worktrees

Create isolated git worktrees and verify ignored directories.

24|5|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/yves-s/just-ship --skill using-git-worktrees-yves-s
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/yves-s/just-ship/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/yves-s/just-ship --skill using-git-worktrees-yves-s

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching contexts. This approach provides a safe, parallel development environment when experimentation or feature work requires isolation from the main workspace.

Core Features & Use Cases

  • Directory selection and isolation: preferentially reuses existing worktree directories, then consults CLAUDE.md for preferences, or asks the user for a location, ensuring safe isolation.
  • Safety verification: checks that the selected local worktree directory is ignored by git to prevent accidental commits of worktree contents; if not ignored, it updates .gitignore and records changes.
  • Automated creation and setup: detects the project name, creates the worktree on a new branch, and auto-runs project setup steps for common toolchains (Node.js, Rust, Python, Go) to establish a clean baseline.
  • Validation and readiness: runs project tests to confirm a clean baseline before starting feature work.

Quick Start

Set up an isolated git worktree for a new feature and verify it remains ignored by the repository.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I use git worktrees to isolate feature work in parallel branches?

Git worktrees isolate feature work by creating separate working directories that share a single repository, allowing you to run multiple branches simultaneously without changing contexts. This approach provides a safe, parallel development environment for experimentation.

How does git worktree directory selection ensure my main workspace stays safe?

Git worktree directory selection ensures safety by reusing existing worktree folders, consulting project preferences, or asking for a location. It then verifies the chosen path is ignored by git to prevent accidental commits of worktree contents into the main workspace.

Can I automatically install project dependencies when creating a new git worktree?

Yes, you can automatically install project dependencies when creating a git worktree. The setup process detects the project name, creates the worktree on a new branch, and auto-runs setup steps for common toolchains like Node.js, Rust, Python, and Go to establish a clean baseline.

What is the best way to prevent accidental commits of worktree directories in git?

The best way to prevent accidental commits is by verifying that your local worktree directory is ignored by git. If the selected directory is not ignored, the setup process updates .gitignore and records the changes to ensure isolation.

Does git worktree setup validate a clean baseline before starting development?

Yes, git worktree setup validates a clean baseline before development proceeds. After creating the worktree and installing dependencies, it runs project tests to confirm everything is working correctly and ready for new feature work.

When do I need to use git worktrees instead of standard git branches?

You need git worktrees when multiple branches or experiments run in parallel and require isolation from your main workspace. Worktrees allow simultaneous work on different branches without switching contexts, providing a safe environment for feature development.