using-git-worktrees

A tool for creating and managing isolated Git worktrees efficiently and safely, ensuring your main workspace stays clean and your builds are reproducible. It .----This is the wrong one, ignore it. Let's try again.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/hitsumabushi334/KGpaper --skill using-git-worktrees-hitsumabushi334
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/hitsumabushi334/KGpaper/tree/main/.agent/Skills/using-git-worktrees
Command: npx skills add https://github.com/hitsumabushi334/KGpaper --skill using-git-worktrees-hitsumabushi334

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill creates isolated git workspaces to enable feature development without modifying or cluttering the current workspace.

Core Features & Use Cases

  • Directory priority and discovery: selects an existing local worktree directory (.worktrees or worktrees) or follows CLAUDE.md preferences, with a user prompt when ambiguity remains.
  • Safety-first setup: verifies project-local worktrees are ignored by git to prevent accidental commits, and provides remediation steps if needed.
  • Flexible deployment: supports project-local or global worktree locations, auto-detects the project name, and tailors the creation flow to the project structure.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace.

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 workspace for feature development?

To create an isolated git workspace, this skill uses git worktree add to set up a separate directory. It auto-detects the project name and runs any available project setup scripts to establish a clean baseline for your new feature.

Where should I put my git worktrees to keep them safe from accidental commits?

Git worktrees should be placed in project-local directories like .worktrees or worktrees, or global locations based on CLAUDE.md preferences. The setup verifies that local worktree directories are ignored by git to prevent accidental commits, providing remediation if needed.

Can I use git worktrees for experiments without cluttering my current workspace?

Yes, git worktrees isolate feature development and experiments from your current workspace. The skill applies directory discovery by priority and performs safety checks to ensure a clean baseline without modifying your existing working directory.

What's the best way to manage multiple git branches in separate directories?

Using git worktree add creates isolated workspaces for managing multiple branches in separate directories. This approach tailors the creation flow to your project structure, supporting both project-local and global worktree locations based on directory priority and preferences.

Does git worktree setup work with existing project setup scripts?

Yes, git worktree setup runs project setup scripts when they are present in the repository. After creating the worktree with git worktree add, the skill automatically executes these scripts to prepare the isolated environment for development.

What happens if my git worktree directory is not ignored by git?

If your project-local worktree directory is not properly ignored by git, the setup detects this safety issue and provides remediation steps. This prevents accidental commits of the worktree directory itself, ensuring a safe development workflow.