using-git-worktrees

Create and manage git worktrees with branch naming and baseline tests.

6|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/moberghr/mtk-agent-toolkit --skill using-git-worktrees-moberghr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/moberghr/mtk-agent-toolkit/tree/main/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/moberghr/mtk-agent-toolkit --skill using-git-worktrees-moberghr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Isolate work with dedicated git worktrees to prevent contaminating the main branch during feature development, experiments, or parallel work.

Core Features & Use Cases

  • Create and manage isolated worktrees for individual tasks, branches, or experiments.
  • Verify and respect repository policies before creating a worktree, including gitignore checks.
  • Finish workflows safely by merging, pushing, or discarding worktrees with guardrails.

Quick Start

Create an isolated git worktree for a feature on a new branch, install dependencies if needed, and run baseline tests before starting work.

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 workspaces for parallel feature work?

Git worktrees let you create isolated workspaces for individual tasks or branches, preventing contamination of the main branch during feature development. Each worktree maintains its own working directory while sharing the same repository.

What is the best way to protect the main branch during feature development and experiments?

Protecting the main branch is achieved by using git worktrees to isolate feature work, which enforces branch naming, dependency installation, and baseline test execution before development begins, ensuring clean rollback paths.

Can I automatically install dependencies and run baseline tests when setting up a git worktree?

Yes, when provisioning a git worktree, the workflow can automatically install dependencies if needed and execute baseline tests before development begins, ensuring the isolated environment is fully validated and ready for work.

How do I safely finish or discard a git worktree after feature work is complete?

Worktrees can be safely finished by merging, pushing, or discarding the work with built-in guardrails. The workflow verifies repository policies before creation and ensures safe cleanup paths when the isolated work is no longer needed.

When should I use git worktrees instead of standard git branches for experiments?

Git worktrees are necessary for experiments and parallel work where you need isolation and clean rollback paths, allowing you to maintain multiple working directories simultaneously without contaminating the main branch.