using-git-worktree

Create isolated Git worktrees for parallel branch development with automated setup.

Updated Oct 29, 2025
One-click install
npx skills add https://github.com/hmps/skills --skill using-git-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktree
Source: https://github.com/hmps/skills/tree/main/using-git-worktree
Command: npx skills add https://github.com/hmps/skills --skill using-git-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the complex setup of isolated Git worktrees, allowing you to work on multiple branches simultaneously without interference. It eliminates manual configuration errors and ensures a clean, tested baseline for every new feature or bug fix, saving setup time and preventing environment conflicts.

Core Features & Use Cases

  • Bare Repo Detection: Intelligently locates the bare Git repository root to ensure worktrees are created correctly as siblings.
  • Automated Project Setup: Detects and runs appropriate dependency installation commands (npm, cargo, pip, go mod) for a seamless setup.
  • Clean Baseline Verification: Automatically runs project tests after setup to confirm a stable, working environment before development begins.
  • Use Case: Before starting a new feature, use this Skill to create a dedicated worktree. It will set up the branch, install dependencies, and verify tests, providing you with an isolated, ready-to-code environment in seconds.

Quick Start

Use the using-git-worktree skill to create a new worktree for the 'feature/user-onboarding' branch. Ensure all dependencies are installed and tests pass.

Frequently Asked Questions about using-git-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I work on multiple Git branches simultaneously without switching?

Git worktrees create isolated workspaces for each branch, allowing parallel development on main, feature-a, and feature-b without context switching. Each worktree is a separate directory linked to your bare repository, so you edit independently across branches.

What's the best way to set up a new feature branch with dependencies already installed?

Use git worktree add to create an isolated workspace, then automatically detect and install dependencies via npm, cargo, pip, or go mod based on your project files. This automation eliminates manual setup errors and gets you coding faster.

How do I ensure a clean, tested environment before starting development on a new branch?

After creating a worktree and installing dependencies, run project tests automatically to verify a stable baseline. This confirms your environment is ready and prevents development delays caused by broken dependencies or failing tests.

Can I use git worktrees with a bare repository setup?

Yes, this Skill is specifically designed for bare repository setups. It auto-detects the .bare directory by traversing upward, then creates worktrees as root-level siblings, making it ideal for team workflows using centralized bare repos.

What languages and package managers does automated setup support?

Automated dependency installation detects and runs setup for Node.js (npm), Rust (cargo), Python (pip, pyproject.toml), and Go (go mod). If your project uses one of these tools, setup runs without manual intervention.

Why should I use worktrees instead of manually switching branches?

Worktrees eliminate branch-switching delays, prevent accidental stale builds, and let you run tests and development tasks on multiple branches in parallel. Each worktree is isolated, so environment state never leaks between branches.