using-git-worktrees

Create and manage isolated Git worktrees with safety checks and project setup.

6|Updated Mar 24, 2019
One-click install
npx skills add https://github.com/rafifos/dotfiles --skill using-git-worktrees-rafifos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/rafifos/dotfiles/tree/main/dot_agents/skills/using-git-worktrees
Command: npx skills add https://github.com/rafifos/dotfiles --skill using-git-worktrees-rafifos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Isolate workspaces for feature development by creating and managing Git worktrees with safety checks, preventing contamination of the main repository.

Core Features & Use Cases

  • Directory discovery and selection prioritization (project-local first, then global)
  • Safety verification to ensure worktrees are ignored by git and do not commit unintended changes
  • Automatic project-setup orchestration across common tools (npm, cargo, pip, etc.) after creating the worktree
  • Use Case: Start a new feature branch in an isolated environment and run project-specific setup without affecting main workspace

Quick Start

Initialize a new isolated git worktree for the current project and prepare a clean baseline.

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 isolated Git worktrees for feature development without affecting my main workspace?

Git worktrees isolate feature branches by creating separate working directories from the same repository. This Skill automates worktree creation across local and global locations, ensuring the main workspace remains uncontaminated during parallel development.

What is the safest way to set up automated Git worktrees?

Safe Git worktree setup requires verifying the worktree directory is ignored by git to prevent unintended commits. This Skill validates your .gitignore rules for project-local worktrees and enforces safety checks before finalizing the isolated environment.

Does Git worktree automation work with npm, cargo, and pip project setups?

Yes, Git worktree automation detects project context by checking for files like package.json, Cargo.toml, or requirements. It automatically orchestrates the appropriate project-specific setup steps, such as npm install or cargo build, immediately after creating the worktree.

Can I use a global directory location for my Git worktrees instead of project-local paths?

Yes, Git worktrees can be created in global directory locations. This Skill features directory discovery and selection prioritization, defaulting to project-local paths first before falling back to global locations for flexible workspace isolation.

Why does my automated Git worktree setup run baseline tests before finishing?

Automated worktree setups run baseline tests to validate the new environment and ensure project stability. This Skill enforces safety checks and executes baseline tests before signaling readiness, confirming the isolated workspace is fully prepared for development.

What's the best way to manage multiple isolated Git worktrees for parallel feature branches?

Managing multiple isolated worktrees is best handled by automating directory discovery, gitignore validation, and project setup orchestration. This approach prevents workspace pollution and ensures each feature branch operates in a clean, verified environment.