using-git-worktrees

Create isolated git worktrees with automatic directory selection and safety checks.

146|35|Updated Mar 20, 2023
One-click install
npx skills add https://github.com/mwangli/stock-trading --skill using-git-worktrees-mwangli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/mwangli/stock-trading/tree/main/.trae/skills/using-git-worktrees
Command: npx skills add https://github.com/mwangli/stock-trading --skill using-git-worktrees-mwangli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates isolated git worktrees for feature work to keep the main workspace clean and safe from intrusive changes.

Core Features & Use Cases

  • Directory selection priority: reuse existing hidden .worktrees or public worktrees, respect CLAUDE.md hints, or prompt the user.
  • Safety verification: ensures the chosen directory is ignored by git to prevent accidental commits of worktree contents.
  • Auto-setup: detects project type (Node, Python, Rust, Go) and runs the appropriate setup commands automatically.
  • Use Case: Start a new feature on a separate branch without touching the main branch, then merge when ready.

Quick Start

Create a new isolated worktree for your feature branch and let the skill auto-detect and run the appropriate project setup.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I create an isolated git worktree for feature development without disturbing the main workspace?

To create an isolated git worktree, you can use a tool that automatically selects a directory, verifies it is ignored by git to prevent accidental commits, and sets up a clean baseline branch for concurrent feature work.

What is the best way to manage multiple git worktrees for separate branches safely?

Managing git worktrees safely involves using directory selection priority that reuses hidden or public worktree folders, respects project configuration hints, and performs safety checks to ensure the worktree contents are ignored by git.

Does git worktree setup support auto-detection for different project types like Node and Python?

Yes, git worktree setup can auto-detect project types such as Node, Python, Rust, and Go, automatically running the appropriate setup commands based on your project files after the workspace is created.

How do I prevent accidental commits of worktree contents into the main repository?

To prevent accidental commits of worktree contents, a safety verification step checks that the chosen isolated directory is properly ignored by git before initializing the workspace for feature development.

Can I use a global storage location for isolated git worktrees instead of a project-local one?

Yes, you can configure isolated git worktrees to use either project-local hidden directories or global storage locations, with directory selection prioritizing existing worktree folders or project configuration hints.

When do I need to use an isolated workspace for git branch management?

You need an isolated workspace when starting new features, bug fixes, or experiments that require separate branches, allowing you to maintain a clean baseline in the main repository without intrusive changes.