using-git-worktrees

Creates and manages isolated Git worktrees for feature branches with directory selection and safety checks.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/Itzalive/resistance-ai --skill using-git-worktrees-itzalive
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Itzalive/resistance-ai/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/Itzalive/resistance-ai --skill using-git-worktrees-itzalive

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees allow working on multiple branches within the same repository by creating isolated workspaces that share the repository history. This skill solves the problem of needing feature isolation without constantly switching branches, reducing context-switching and risk of interfering with the main workspace.

Core Features & Use Cases

  • Directory selection and isolation: prioritizes existing local worktree directories (.worktrees or worktrees), then CLAUDE.md preferences, and finally prompts the user.
  • Safety verification: ensures the chosen worktree directory is ignored by Git and suggests adding to .gitignore if needed to avoid accidental commits.
  • Automated setup and baseline: after worktree creation, auto-detects project type and runs project setup commands (e.g., install dependencies) to ensure a clean baseline.
  • Use cases: starting feature work that requires isolation, debugging across branches, and safe experimentation without touching the main working tree.

Quick Start

Create an isolated git worktree for your current feature branch.

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 an isolated Git worktree for feature branch development?

Git worktrees allow you to work on multiple branches simultaneously by creating isolated workspaces that share repository history. They solve the problem of needing feature isolation without constantly switching branches, reducing context-switching and risk of interfering with the main workspace.

How do I prevent my Git worktree directory from being accidentally committed?

To prevent accidental commits, this skill verifies that the chosen worktree directory is ignored by Git. It performs safety verification and suggests adding the directory to .gitignore if needed to protect your main repository history.

Does the worktree creation process automatically install project dependencies?

Yes, after worktree creation, the skill auto-detects the project type and runs project setup commands, such as installing dependencies. This ensures a clean baseline for safe experimentation without touching the main working tree.

Can I specify a custom global location for my Git worktrees?

Yes, you can use custom project-local or global locations for your Git worktrees. The skill handles directory existence checks and case sensitivity across .worktrees and worktrees folder naming conventions before creating the isolated workspace.

What are the limitations of using Git worktrees for branch isolation?

Git worktrees are limited by directory existence conflicts if the target path is already populated, and they require proper .gitignore configuration to prevent accidental commits of the worktree directory itself into the main repository history.