using-git-worktrees

Create isolated git worktrees and run project install, build, and test commands.

3|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/DYAI2025/Stoppclock-page --skill using-git-worktrees-dyai2025
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/DYAI2025/Stoppclock-page/tree/main/stoppclock_speckit/.claude/commands/SKILL (17).md
Command: npx skills add https://github.com/DYAI2025/Stoppclock-page --skill using-git-worktrees-dyai2025

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines development by creating isolated Git worktrees, allowing you to work on multiple features or bug fixes concurrently without branch switching or merge conflicts. It ensures a clean, reproducible development environment.

Core Features & Use Cases

  • Isolated Workspaces: Create separate directories for different branches, sharing the same repository.
  • Safety Verification: Automatically checks .gitignore and runs baseline tests to ensure a clean start.
  • Use Case: Work on a critical hotfix while a long-running feature is in progress, or experiment with a new idea without disrupting your main development branch.

Quick Start

Announce: "I'm using the using-git-worktrees skill to set up an isolated workspace."

Example: Create a worktree for an 'auth' feature

git checkout -b feature/auth

git worktree add .worktrees/auth feature/auth

cd .worktrees/auth

npm install && npm test

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I work on multiple git branches without switching workspaces?

Git worktrees create isolated directories for different branches within the same repository, letting you work on multiple features concurrently. Each worktree is a separate checkout sharing the same .git directory, so you avoid branch switching and merge conflicts.

Can I create a git worktree in my project directory?

Yes. The Skill supports project-local worktrees in a .worktrees directory and checks .gitignore to ensure safety before creating them. It also respects CLAUDE.md preferences for custom locations if specified.

What happens after I create a worktree—does it install dependencies?

The Skill auto-detects your project tooling (npm, Cargo, pip, pyproject.toml, go.mod) and runs install, build, and test commands automatically, delivering a ready-to-code environment in the new worktree.

How do git worktrees prevent merge conflicts during concurrent development?

Each worktree is an independent checkout of a different branch, so changes in one worktree don't affect others until explicitly merged. You work in isolation, reducing accidental conflicts when multiple features are in flight.

Do I need to clean up worktrees manually after finishing a feature?

Worktrees are persistent directories under .worktrees or a custom location. You can delete them manually or integrate cleanup into your workflow after merging; the Skill creates them but doesn't auto-remove them.

What if my project uses a non-standard build tool or package manager?

The Skill detects package.json, Cargo.toml, requirements.txt, pyproject.toml, and go.mod. If your project uses a different build system, you'll need to run install and test commands manually in the worktree after creation.

Related Skills