using-git-worktrees

Create isolated git worktrees for feature branches in project-local or global directories.

Updated Apr 25, 2026
One-click install
npx skills add https://github.com/tomasbasso/SistemaStockV2 --skill using-git-worktrees-tomasbasso
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/tomasbasso/SistemaStockV2/tree/main/.agents/skills/uso-espacios-aislados-git-worktree
Command: npx skills add https://github.com/tomasbasso/SistemaStockV2 --skill using-git-worktrees-tomasbasso

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Isolate feature work by creating dedicated git worktrees that share the same repository, enabling parallel development without modifying the main workspace.

Core Features & Use Cases

  • Safe directory selection: prefers .worktrees, then worktrees, then global locations.
  • Automatic worktree creation: creates a new worktree for a specified branch and navigates into it.
  • Safety verifications: checks if the chosen directory is ignored by gitignore and updates ignore rules when needed.
  • Flexible placement and cleanup: supports project-local and global worktree directories and provides guidance for cleanup after work is complete.

Quick Start

Tell me the feature branch name and repository path, and I will create an isolated git worktree in the preferred location and switch to it.

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 a new feature branch?

To create an isolated git worktree, you specify the feature branch name and repository path. The system then automatically creates a new worktree using the -b BRANCH_NAME flag and navigates into it, keeping your main workspace untouched.

What is the safest directory location for creating parallel git worktrees?

The safest directory locations for git worktrees are project-local directories. The system prefers creating worktrees in a local .worktrees directory first, then a worktrees directory, before falling back to global locations.

How does git worktree isolation prevent modifying the main workspace state?

Git worktree isolation prevents main workspace modifications by creating dedicated directories that share the same repository. This allows you to develop features and experiment on multiple branches using a clean baseline separated from the current repo state.

Do I need to update gitignore before adding a new git worktree directory?

You do not need to manually update gitignore before adding a worktree. The system performs safety verifications to check if the chosen directory is ignored by gitignore and updates the ignore rules automatically when needed.

What is the best way to clean up git worktrees after feature development is complete?

The best way to clean up git worktrees is to follow the system's provided guidance for cleanup after work is complete. This ensures proper removal of the isolated directories while preserving the shared repository integrity.