using-git-worktrees

Create isolated Git worktrees for feature branches with setup and baseline checks.

20|3|Updated Aug 16, 2016
One-click install
npx skills add https://github.com/heyJordanParker/dotfiles --skill using-git-worktrees-heyjordanparker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/heyJordanParker/dotfiles/tree/main/claude/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/heyJordanParker/dotfiles --skill using-git-worktrees-heyjordanparker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill enables safe isolation of feature work by automatically creating dedicated Git worktrees linked to the current repository, preventing interference with the main workspace.

Core Features & Use Cases

  • Isolated workspaces via git worktrees that share the same repository but keep changes separate per feature.
  • Directory prioritization and safety verification: prefer .worktrees/, then worktrees/, verify that the target path is ignored by .gitignore, and automatically add it if needed.
  • Automatic project setup and baseline checks: after creating a worktree, run common setup steps (Node.js, Rust, Python, Go) and verify a clean test baseline.
  • Use Case: When starting a new feature, create a dedicated worktree on a new branch without touching the main branch, run tests, and report status and location.

Quick Start

Provide a target BRANCH_NAME and LOCATION (e.g., BRANCH_NAME=feature-x LOCATION=.worktrees). The skill will detect the preferred directory, verify .gitignore, create the worktree at the correct path, switch into it, and perform project setup and testing as needed.

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 development work from my main git workspace?

Isolate feature development by creating dedicated git worktrees linked to your repository, keeping changes separate without altering the main workspace. This prevents interference by maintaining isolated branches for new features or bug fixes in a distinct directory.

How do I set up a new git worktree for a feature branch?

Set up a git worktree by providing a target branch name and location. The process automatically prioritizes the .worktrees/ or worktrees/ directory, verifies .gitignore settings, creates the worktree at the correct path, and performs project setup.

Does git worktree creation handle project setup for Node.js, Rust, Python, and Go?

Yes, git worktree creation handles project setup for Node.js, Rust, Python, and Go. It auto-detects project tooling like npm, cargo, go, or pip, runs common setup steps, and verifies a clean test baseline after creating the worktree.

What is the best way to manage git worktree directories and gitignore safety?

The best way to manage git worktree directories is through automatic directory prioritization and .gitignore verification. It prefers .worktrees/ then worktrees/, checks if the target path is ignored, and automatically adds it to .gitignore if needed for safety.

Can I run tests automatically after creating a git worktree?

Yes, you can run tests automatically after creating a git worktree. The workflow performs automatic project setup and baseline checks, executing common setup steps and verifying a clean test baseline before reporting the status and location.