using-git-worktrees

Create isolated git worktrees with verified .gitignore and clean test baselines.

24|8|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/vadimcomanescu/codex-skills --skill using-git-worktrees-vadimcomanescu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/vadimcomanescu/codex-skills/tree/main/skills/.experimental/devtools/using-git-worktrees
Command: npx skills add https://github.com/vadimcomanescu/codex-skills --skill using-git-worktrees-vadimcomanescu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Isolates feature or implementation work in separate git worktrees so developers can work on multiple branches without disrupting the main working tree or accidentally committing workspace artifacts.

Core Features & Use Cases

  • Safe directory selection: Prefer project-local .worktrees/ or worktrees/ and fall back to a global location when appropriate.
  • Repository safety checks: Verify project .gitignore contains the chosen worktree directory and require remediation if it does not.
  • Automated setup & baseline verification: Create a worktree with a new branch, run project-specific setup (dependency install/build), and run tests to confirm a clean baseline before work begins.
  • Use Case: Start feature development by creating an isolated worktree for a feature branch, ensure the worktree is ignored, run installs/tests, and report readiness.

Quick Start

Use the using-git-worktrees skill to create an ignored .worktrees/<branch> workspace, verify .gitignore, run project setup, and confirm tests pass before starting development.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I use git worktrees to work on multiple branches without disrupting the main repository?

Git worktrees create isolated directory checkouts, allowing you to work on multiple branches simultaneously without disrupting the main working tree. This avoids switching branches constantly and prevents accidental commits of workspace artifacts.

How do I create a git worktree that is safely ignored by my project?

To create a safe git worktree, select a project-local directory like .worktrees/, verify it exists in your .gitignore, and run git worktree add. Remediation is required if the directory is not ignored.

Can I automatically run project setup and tests when creating a new git worktree?

Yes, after adding a worktree, you can automatically run project-specific setup like dependency installation or builds, and execute tests to validate a clean baseline before you begin feature development.

What is the best way to manage concurrent branch workspaces for feature development?

Using git worktrees is the best way to manage concurrent branch workspaces. They provide isolated directories for feature development, testing, and implementation planning without altering the main repository state.

Why does my git worktree directory show up as untracked files in the main repository?

Your git worktree directory appears as untracked files because it is missing from your project .gitignore. You must verify .gitignore contains the worktree directory path and add it if absent.