using-git-worktrees

Manage Git worktrees to isolate feature work in separate directories.

968|43|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/GanyuanRan/Aegis --skill using-git-worktrees-ganyuanran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/GanyuanRan/Aegis/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/GanyuanRan/Aegis --skill using-git-worktrees-ganyuanran

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees allow you to create isolated workspaces that share the same repository, enabling concurrent feature work without switching branches in the main working tree.

Core Features & Use Cases

  • Directory selection: Reuses existing worktree directories according to a clear priority, minimizing setup time.
  • Safety verification: Ensures the chosen local worktree is ignored by gitignore to prevent accidental commits.
  • Automatic setup & planning: Detects the project structure and runs setup steps appropriate for common languages and tools.
  • Use Case: Start a new feature or experimental work in an isolated directory while preserving a clean main workspace.

Quick Start

Create or select an isolated worktree for the current project and switch into it to start feature 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 isolate feature work without switching branches in my main Git workspace?

Git worktrees create isolated workspaces sharing the same repository, enabling concurrent feature work without switching branches. This allows you to start new features or experiments in separate directories while preserving a clean main workspace.

How do I set up a Git worktree for a new feature?

To set up a Git worktree, the process selects an isolated directory, verifies ignore rules, and runs project setup checks. It automatically detects the project structure and executes setup steps appropriate for common languages and tools.

Why should I verify gitignore rules before creating a Git worktree?

Verifying gitignore rules ensures the local worktree is ignored to prevent accidental commits. This safety check protects your active repository workspace from unintended changes when working in separate directories.

Can I reuse existing worktree directories for feature development?

Yes, you can reuse existing worktree directories according to a clear priority system, minimizing setup time. The process selects the correct directory automatically and performs project setup checks before work begins.

What is the best way to manage experimental code in an isolated directory?

Git worktrees are the best way to manage experimental code in an isolated directory because they share the same repository while preventing changes to the active repository workspace. They enforce safety by verifying ignore rules before work begins.

Does Git worktree setup work with different programming languages and tools?

Git worktree setup works with common languages and tools by detecting the project structure and running appropriate setup steps. This automatic setup and planning ensures the correct environment is configured before feature work begins.