using-git-worktrees

Create isolated git worktrees for each feature branch.

1|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/danilonovaisv/PROMPT-APP --skill using-git-worktrees-danilonovaisv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/danilonovaisv/PROMPT-APP/tree/main/.agent/skills/using-git-worktrees
Command: npx skills add https://github.com/danilonovaisv/PROMPT-APP --skill using-git-worktrees-danilonovaisv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline feature development by enabling isolated workspaces through git worktrees, so you never work directly on the main branch.

Core Features & Use Cases

  • Create a dedicated worktree for each feature, keeping the main branch pristine and reducing merge conflicts.
  • Quickly switch contexts between multiple features or experiments without stashing or duplicating worktrees.
  • Enforce a safe finish flow by cleaning up worktrees after feature completion and ensuring a clean repository state.

Quick Start

Initiate a new feature work by creating a separate worktree for the feature branch, navigate to it, install dependencies if needed, run tests, implement changes, commit frequently, and finish by removing the worktree when done.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
What is a git worktree and how does it help with feature development?

A git worktree creates an isolated workspace for each feature branch, keeping your main branch pristine. It enables parallel feature development and quick context switching without stashing changes or duplicating repositories.

How do I create an isolated workspace for a new feature branch?

To create an isolated workspace, initiate a new worktree for your feature branch, navigate into it, and install dependencies. This separates your changes from the main branch and reduces merge conflicts during feature development.

How do I switch between multiple git branches without stashing changes?

You can switch contexts between multiple features by navigating between their respective dedicated worktrees. This workflow eliminates the need to stash uncommitted changes, allowing you to resume ongoing tasks immediately in each isolated directory.

Do I need to install dependencies separately in each git worktree?

Yes, each git worktree operates as a separate working directory. When you create a new worktree for a feature branch, you must install project dependencies within that isolated directory before running tests or implementing changes.

What is the best way to clean up git worktrees after finishing a feature?

The best way to clean up is to follow a defined finish routine that removes the worktree after your feature is complete. This ensures a clean repository state by eliminating abandoned working directories and preventing branch clutter.

When should I use git worktrees instead of standard git branching?

You should use git worktrees when you need to run parallel tasks like feature development, bug fixes, or design reviews simultaneously. Worktrees prevent interference between ongoing tasks by providing physical directory isolation for each branch.