using-git-worktrees

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

Updated Jan 12, 2026
One-click install
npx skills add https://github.com/Suara17/guanlan-sina --skill using-git-worktrees-suara17
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Suara17/guanlan-sina/tree/main/.opencode/skills/using-git-worktrees
Command: npx skills add https://github.com/Suara17/guanlan-sina --skill using-git-worktrees-suara17

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use this skill to create isolated git worktrees for feature development, preserving the main workspace while enabling parallel work on new branches with automatic safety checks.

Core Features & Use Cases

  • Directory priority: Detects an existing hidden .worktrees or standard worktrees directory to reuse.
  • CLAUDE.md preference: Honors project-specified worktree directory preferences when present.
  • Safety verification: Verifies ignore rules before creating a local worktree to prevent accidental commits of worktree content.
  • Project setup automation: After creation, automatically runs project setup steps based on common project files (package.json, Cargo.toml, requirements.txt, etc.).

Quick Start

You can use this skill to set up an isolated workspace with a feature branch (e.g., feature/your-branch) and go from there.

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?

To create an isolated git worktree, the skill discovers an existing hidden .worktrees or standard directory, honors CLAUDE.md preferences, and verifies git ignore rules before setting up the workspace.

How does git check-ignore prevent accidental commits in worktrees?

Git check-ignore verifies ignore rules before creating a local worktree, preventing accidental commits of worktree content into the main repository branch history.

Can I automatically run project setup steps after creating a git worktree?

Yes, project setup automation runs after worktree creation by detecting common project files like package.json, Cargo.toml, or requirements.txt to configure the isolated dev environment.

What is the best way to manage parallel feature branches without disrupting the main workspace?

Using isolated git worktrees is the best way to manage parallel feature branches, preserving the main workspace while applying directory priority rules and safety verification.

Does git worktree creation honor project-specified directory preferences?

Yes, worktree creation honors project-specified directory preferences defined in a CLAUDE.md file, automatically detecting and reusing existing hidden .worktrees directories.

When should I not use a local git worktree for branch isolation?

You should avoid local git worktrees if your project lacks proper git ignore rules, as the safety verification step requires check-ignore to prevent accidental commits of isolated content.