using-git-worktrees

Create isolated Git worktrees and verify clean test baselines.

Updated May 5, 2026
One-click install
npx skills add https://github.com/XCmiaow/cc-deploy --skill using-git-worktrees-xcmiaow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/XCmiaow/cc-deploy/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/XCmiaow/cc-deploy --skill using-git-worktrees-xcmiaow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of working on multiple features or branches without polluting your current workspace or accidentally committing unintended files to the main repository.

Core Features & Use Cases

  • Isolated workspaces via Git worktrees: Creates separate directories that share the same repository, so you can work on several branches simultaneously.
  • Deterministic directory selection: Uses a priority order of existing local directories, preferences found in CLAUDE.md, or prompts the user when ambiguous.
  • Safety verification to prevent accidental commits: For project-local worktree directories, it verifies the target directory is ignored by git before creating it, and if not ignored it instructs the user to update .gitignore and commit the change before proceeding.
  • Baseline readiness checks: Runs project-appropriate setup (Node/Rust/Python/Go) when relevant project files exist, then executes tests to confirm the new worktree starts clean.

Quick Start

Use the using-git-worktrees skill to create an isolated worktree for your next feature branch and verify a clean test baseline before you start implementing.

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 at the same time without changing my current workspace?

Git worktrees create isolated directories sharing the same repository, allowing concurrent feature development without stashing or switching branches. This prevents workspace pollution and keeps your main branch stable while testing changes in a separate location.

How do I prevent accidental commits of worktree directories to my main Git repository?

Verify your project-local worktree target directories are added to .gitignore before creation. If a directory is not ignored, update .gitignore and commit the change before proceeding with worktree setup to prevent accidental file commits.

How do I set up a clean test baseline in a new Git worktree?

Run project-appropriate dependency installation for Node, Rust, Python, or Go when relevant files exist, then execute tests in the new worktree. This validates the environment starts clean before feature implementation begins.

Can I use Git worktrees with my existing Node, Rust, Python, or Go project?

Yes, Git worktrees work with Node, Rust, Python, and Go projects. The setup process detects relevant project files, runs the appropriate dependency installation commands, and validates a clean baseline before you start coding.

What is the best way to manage directory locations when creating multiple Git worktrees?

Use a priority order of existing local directories, preferences found in CLAUDE.md, or user prompts when ambiguous. This deterministic selection ensures consistent location handling across workspaces and avoids directory conflicts.