using-git-worktrees

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps engineers create isolated workspaces for feature development by using git worktrees, allowing multiple branches to be worked on without contaminating the main workspace.

Core Features & Use Cases

  • Directory priority and selection: detects existing local worktree directories (.worktrees or worktrees) and follows CLAUDE.md preferences to determine where to create new worktrees.
  • Safety verification: validates that the chosen directory is ignored by git to prevent accidental commits of worktree contents.
  • Automatic environment setup: auto-detects project type and runs the appropriate setup commands (node, rust, python, go) to initialize the new workspace.
  • Operational flow: detects the project name, creates a new worktree with a new branch, and validates a clean baseline with tests.
  • Use-case example: a developer wants to start work on a feature without touching the main branch; the skill provisions a dedicated worktree, runs initial setup, and returns a ready status.

Quick Start

Set up an isolated git worktree for your current feature branch.

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 with git worktrees?

You can isolate feature work with git worktrees by provisioning a dedicated workspace directory, creating a new branch, and running automatic project setup to avoid contaminating your main branch.

How does git check-ignore verify worktree safety?

Git check-ignore verifies worktree safety by validating that the chosen worktree directory is properly ignored in gitignore, preventing accidental commits of worktree contents to the repository.

Can I automatically setup node, rust, python, or go environments in a new git worktree?

Yes, automatic environment setup detects your project type and runs the appropriate initialization commands for node, rust, python, or go to prepare the new git worktree workspace.

Does git worktree creation work with global directory locations?

Git worktree creation supports both project-local directories and global worktree locations, automatically selecting the directory based on existing folders or user preferences.

What is the best way to manage multiple git branches without workspace contamination?

Using git worktrees is the best way to manage multiple branches safely, as it isolates feature development in separate directories and validates a clean baseline with tests before you start.