using-git-worktrees

Create isolated Git worktrees with directory selection and safety verification.

1|Updated May 25, 2025
One-click install
npx skills add https://github.com/circld/dotfiles --skill using-git-worktrees-circld
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/circld/dotfiles/tree/main/external/opencode/skills/using-git-worktrees
Command: npx skills add https://github.com/circld/dotfiles --skill using-git-worktrees-circld

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of creating isolated development environments using Git worktrees, ensuring a clean and organized workflow for feature development.

Core Features & Use Cases

  • Isolated Workspaces: Develop features in separate directories without affecting your main branch.
  • Smart Directory Selection: Automatically finds or prompts for the best location to create worktrees.
  • Safety Verification: Ensures project-local worktrees are ignored by Git to prevent accidental commits.
  • Automated Setup: Detects and runs project-specific setup commands (e.g., npm install, cargo build).
  • Baseline Testing: Verifies the new worktree is in a clean state by running project tests.
  • Use Case: Before starting a new feature like "user authentication," you can use this skill to create a dedicated worktree, install dependencies, and confirm the base project is stable, all before writing a single line of new code.

Quick Start

Use the using-git-worktrees skill to create a new worktree for the 'feature/user-profile' 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 create an isolated Git worktree for feature development?

To create an isolated Git worktree, this Skill automates directory selection for your feature branch and verifies .gitignore rules to prevent accidental commits of worktree directories.

Can I automate dependency installation when setting up a new Git worktree?

Yes, you can automate dependency installation during Git worktree setup. This Skill detects and runs project-specific setup commands like npm install or cargo build to prepare the environment automatically.

What is the best way to work on multiple Git branches concurrently?

The best way to work on multiple branches concurrently is using Git worktrees. This Skill creates isolated workspaces in separate directories, allowing you to develop features without affecting your main branch.

How do I verify a new Git worktree is stable before writing code?

You verify a new Git worktree is stable by running baseline tests. This Skill executes project tests after setup to confirm the new worktree is in a clean working state before development begins.

Does this Git worktree workflow support project-local directory management?

Yes, this Git worktree workflow supports project-local directory management. It intelligently manages both project-local and global worktree locations while enforcing .gitignore checks for safety.

Why should I ignore project-local Git worktrees in version control?

You should ignore project-local Git worktrees to prevent accidental commits of development directories. This Skill enforces .gitignore checks to ensure worktree locations are safely excluded from version control.