using-git-worktrees

Create isolated Git worktrees with automatic project bootstrap and safety checks.

Updated Nov 8, 2024
One-click install
npx skills add https://github.com/cqkxxc/cqkxxc.github.io --skill using-git-worktrees-cqkxxc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/cqkxxc/cqkxxc.github.io/tree/main/.trae/skills/using-git-worktrees
Command: npx skills add https://github.com/cqkxxc/cqkxxc.github.io --skill using-git-worktrees-cqkxxc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

Core Features & Use Cases

  • Directory priority: prefer .worktrees, then worktrees, with CLAUDE.md guidance and user prompts
  • Safety verification to ensure worktrees are ignored by git where appropriate
  • Automatic project bootstrap: detects language tooling (Node, Rust, Python, Go) and runs installations/builds

Quick Start

Start by specifying your feature branch and let the skill create and configure a separate worktree.

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?

Creating an isolated Git worktree automates setting up a separate directory for parallel feature work. The process handles smart directory selection, prioritizing .worktrees or worktrees folders, and verifies the location is properly ignored by Git.

How does Git worktree isolation keep my current workspace safe?

Git worktree isolation keeps your workspace safe by creating a separate working directory for your feature branch. It performs safety verification to ensure the worktree directory is ignored by Git, preventing accidental commits to the main project.

Can I automatically bootstrap project dependencies when setting up a Git worktree?

You can automatically bootstrap project dependencies when setting up a Git worktree. The feature detects language tooling for Node.js, Rust, Python, or Go, and runs the necessary installation and build commands to prepare the isolated environment.

What is the best way to manage multiple Git worktrees across different locations?

The best way to manage multiple Git worktrees is using smart directory priority. The system prefers a local .worktrees directory, then a worktrees folder, and can also handle global worktree locations while providing CLAUDE.md guidance and user prompts.

Does Git worktree setup validate a clean test baseline before starting feature work?

Git worktree setup validates a clean test baseline before signaling readiness. After creating the isolated worktree and bootstrapping project dependencies, it ensures the environment is correctly configured and safe for starting parallel feature development.

Why should I use Git worktrees instead of switching branches in my main repository?

Git worktrees provide isolation by maintaining separate directories for each feature branch, eliminating the need to switch contexts in your main repository. This allows parallel feature work without disrupting your current workspace or stashing uncommitted changes.