using-git-worktrees

Create isolated Git worktrees with directory selection and safety verification.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust and safe method for creating isolated development environments using Git worktrees, preventing conflicts and ensuring a clean starting point for new tasks.

Core Features & Use Cases

  • Isolated Workspaces: Create separate directories for different branches without duplicating the entire repository.
  • Smart Directory Selection: Automatically finds or prompts for the best location to create worktrees, prioritizing project-local hidden directories.
  • Safety Verification: Ensures project-local worktree directories are ignored by Git before creation to prevent accidental commits.
  • Automated Setup: Detects and runs project-specific setup commands (e.g., npm install, cargo build).
  • Baseline Testing: Verifies that the new worktree starts from a clean state by running project tests.
  • Use Case: When starting a new feature that requires significant changes, use this skill to create a dedicated, isolated worktree, ensuring your main branch remains stable and clean.

Quick Start

Use the using-git-worktrees skill to create a new worktree for the 'feature/new-login' branch in the '.worktrees' directory.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I isolate feature development using Git worktrees?

Git worktrees isolate feature work by creating separate directories for different branches without duplicating the repository. This skill automates smart directory selection and safety verification to ensure a clean environment for concurrent development tasks.

How does Git worktree safety verification prevent accidental commits?

Git worktree safety verification prevents accidental commits by checking that project-local worktree directories are ignored by Git before creation. This ensures your isolated development tasks do not pollute the main repository history.

Can I automate project setup and baseline tests in a new Git worktree?

Yes, you can automate project setup and baseline tests in a new Git worktree. The skill detects and runs project-specific setup commands like npm install or cargo build, then executes tests to verify the new worktree starts from a clean state.

What is the best way to manage project-local or global Git worktree locations?

The best way to manage project-local or global Git worktree locations is using smart directory selection. This skill automatically finds or prompts for the best location, prioritizing project-local hidden directories to keep your workspace organized.

When do I need to create an isolated Git worktree for feature development?

You need to create an isolated Git worktree when starting a new feature that requires significant changes. It provides a dedicated environment for concurrent development tasks, ensuring your main branch remains stable and clean.

Does using-git-worktrees require any external dependencies to manage branches?

No, using-git-worktrees requires no external dependencies to manage branches. It relies entirely on native Git worktree functionality to create isolated development environments and ensure a clean starting point for new tasks.