git-worktrees

Create isolated git worktrees for parallel feature development in one repository.

3|2|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/liauw-media/CodeAssist --skill git-worktrees-liauw-media
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktrees
Source: https://github.com/liauw-media/CodeAssist/tree/main/skills/workflow/git-worktrees
Command: npx skills add https://github.com/liauw-media/CodeAssist --skill git-worktrees-liauw-media

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tackle multiple features concurrently by using git worktrees to keep each feature in its own working directory, avoiding constant branch switching and stash operations.

Core Features & Use Cases

  • No stashing: Changes stay isolated in their dedicated worktree.
  • Parallel development: Work on multiple features in separate directories at the same time.
  • Independent testing: Run tests on one feature while coding another.
  • Quick context switching: Switch workcontexts with simple directory changes.

Quick Start

Create a new worktree for a feature and start working in it, for example: git worktree add -b feature/new-feature ../myapp-feature main

Frequently Asked Questions about git-worktrees

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

FAQPage Schema
How do I work on multiple git branches simultaneously without stashing changes?

Git worktrees let you create isolated working directories for each branch, keeping changes separate without stashing. Use git worktree add -b feature/name ../path main to create a new worktree, then switch between directories to context-switch instantly while each branch maintains its own state.

What's the best way to run tests on one branch while coding another?

Worktrees enable parallel development by housing each branch in its own directory. Run tests in one worktree while making changes in another simultaneously, eliminating the need to switch branches and rebuild each time you want to test different features.

When should I use git worktrees instead of branch switching?

Use worktrees when you need concurrent feature work, urgent fixes alongside ongoing development, or frequent context switching. Worktrees avoid stashing overhead and let you keep multiple branches checked out simultaneously, making them ideal for parallel testing and isolated development workflows.

How do I manage and clean up git worktrees?

Navigate worktrees with git worktree list to see all active branches and their paths. Remove completed worktrees using git worktree remove, and run git worktree prune to clean up stale entries and orphaned administrative files from deleted worktrees.

Can I use git worktrees with an existing repository?

Yes, worktrees work with any repository that has Git with worktree support. You can add worktrees to an existing repo by running git worktree add from your main directory; each new worktree branches from an existing branch like main or develop.

What are the limitations of using git worktrees?

Worktrees cannot share the same branch across multiple trees, and some operations like git fetch may affect all worktrees. Additionally, deleting a worktree's directory without using git worktree remove leaves orphaned administrative files that must be pruned manually.