git-worktree

Create a git worktree and dedicated branch for isolated feature work.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/moonseokchoi-kr/moon-harness --skill git-worktree-moonseokchoi-kr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/moonseokchoi-kr/moon-harness/tree/main/skills/git-worktree
Command: npx skills add https://github.com/moonseokchoi-kr/moon-harness --skill git-worktree-moonseokchoi-kr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Starting isolated feature work without affecting the current working directory by creating a git worktree and a dedicated branch.

Core Features & Use Cases

  • Create a dedicated worktree directory for a feature, with a new branch named feat/<feature-name>.
  • Validate that the worktree path is ignored by git and that the repository remains clean prior to work.
  • Seamlessly switch back to the main workspace after finishing the isolated work.

Quick Start

Create a worktree and branch for your new feature by providing the feature name when prompted.

Frequently Asked Questions about git-worktree

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

FAQPage Schema
How do I start isolated feature work without affecting my current working directory?

To start isolated feature work, you can create a git worktree and a dedicated branch. This sets up a separate directory linked to your repository, allowing you to develop features without modifying your main working directory.

What is a git worktree and when do I need it for feature branch management?

A git worktree is a mechanism that allows you to check out multiple branches into separate directories simultaneously. You need it for feature branch management when you must isolate new feature work from your current working directory.

How do I create a dedicated worktree directory for a new feature?

You create a dedicated worktree directory by providing a feature name when prompted. This generates a new branch named feat/<feature-name> and a worktree located at ./worktrees/<feature-name>.

Does git worktree check if the repository is clean before creating a branch?

Yes, the git worktree creation process validates that the repository remains clean prior to work. It also checks that the target worktree path is ignored by git and not already present.

Can I switch back to the main workspace after finishing work in a git worktree?

Yes, you can seamlessly switch back to the main workspace after finishing your isolated work. The worktree operates independently, leaving your original working directory untouched until you return.

Why should I use git worktree instead of stashing changes for version control?

Git worktree provides a dedicated, persistent directory for your feature work, whereas stashing temporarily shelves changes. Worktrees are ideal when you need to maintain an isolated workspace without losing context or affecting the main branch.