create-git-worktree

Create isolated Git worktrees with branch validation and freshness checks.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/salimhamed/dotfiles --skill create-git-worktree-salimhamed
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-git-worktree
Source: https://github.com/salimhamed/dotfiles/tree/main/.claude/skills/create-git-worktree
Command: npx skills add https://github.com/salimhamed/dotfiles --skill create-git-worktree-salimhamed

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill creates isolated Git worktrees to enable feature work without affecting the main workspace.

Core Features & Use Cases

  • Automated worktree creation with branch verification and freshness checks
  • Safe synchronization of configuration across worktrees
  • Use Case: When starting feature work on a long-lived repository, quickly spin up a clean worktree on the default branch for isolated development.

Quick Start

Use the create-git-worktree skill to create a new worktree for a given branch: python scripts/setup_worktree.py <BRANCH_NAME> [--parent-dir <path>]

Frequently Asked Questions about create-git-worktree

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

FAQPage Schema
How do I create an isolated Git worktree for feature development?

To create an isolated Git worktree, run the Python helper script with your target branch name and optional parent directory path. The script validates the branch, checks origin freshness, calculates paths, and executes git worktree add to set up your isolated development workspace safely.

What does Git worktree isolation do for my development workflow?

Git worktree isolation enables feature development without impacting your main workspace. It creates a separate working directory linked to your repository, allowing you to work on a branch while keeping your primary checkout clean and unaffected by ongoing changes.

Do I need Python to automate Git worktree creation with branch verification?

Yes, this worktree creation process relies on a Python helper script to perform branch validation, default-branch verification, and origin freshness checks. Python executes the setup logic and emits a JSON status before the actual git worktree add command runs.

Can I specify a custom parent directory when setting up a Git worktree?

Yes, you can specify a custom parent directory by passing the optional parent-dir argument to the setup script. The script calculates the worktree path based on this parameter, placing your isolated branch checkout in your desired filesystem location.

What's the best way to safely synchronize configuration across Git worktrees?

Safe configuration synchronization across Git worktrees is handled during the automated setup process. The skill targets workflows requiring a safe isolated environment by verifying the default branch and checking origin freshness before creating the new worktree, ensuring your configuration stays aligned.

Why should I verify the default branch before adding a Git worktree?

Verifying the default branch before adding a Git worktree ensures you are branching from the correct base and that your local repository is fresh relative to origin. This freshness check prevents building new work on stale or outdated branch states.