creating-git-worktree

Create isolated git worktrees and copy environment files.

1|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/kkhys/claude-code-marketplace --skill creating-git-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-git-worktree
Source: https://github.com/kkhys/claude-code-marketplace/tree/main/plugins/base/skills/creating-git-worktree
Command: npx skills add https://github.com/kkhys/claude-code-marketplace --skill creating-git-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, git, grep, awk, tr, and includes scripts (resource) components.

What problem does it solve?

This skill automates the creation of isolated git worktree environments for parallel development, ensuring worktrees sync with the default branch and environment files are copied.

Core Features & Use Cases

  • Sync with remote default branch and create worktree in .git-worktrees/ with branch-name substitutions
  • Copy environment files (.env and .serena) into the new worktree for immediate use
  • Reuse an existing worktree if it already exists to avoid duplicates
  • Use Case: When starting a new feature branch, quickly provision a dedicated worktree and environment setup.

Quick Start

Execute the script to create a worktree for a given branch name.

Frequently Asked Questions about creating-git-worktree

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

FAQPage Schema
How do I set up git worktrees for parallel development on multiple branches?

Git worktrees for parallel development are set up by creating isolated working directories linked to a single repository. This skill automates that process by syncing with the default remote branch and generating a dedicated worktree inside a local .git-worktrees directory.

Can I automatically copy environment files when creating a new git worktree?

Yes, environment files are automatically copied when creating a new git worktree. This skill detects optional .env and .serena files in your repository and duplicates them into the new worktree directory for immediate use.

What is the best way to manage git worktree environments when context switching?

The best way to manage git worktree environments during context switching is using an automated script that provisions isolated directories. This skill reuses existing worktrees to avoid duplicates and applies branch-name substitutions to keep your workspaces organized.

Do I need a remote default branch to automate git worktree creation?

Yes, a remote default branch is required to automate git worktree creation. This skill syncs the new worktree with the remote default branch to ensure your isolated environment starts from the correct project state.

How does the script handle existing git worktrees to prevent duplicates?

To prevent duplicates, the script checks for existing worktrees and reuses them if one already exists for the target branch. This avoids redundant directory creation and preserves your current worktree state across parallel branches.

What dependencies are needed to run automated git worktree scripts?

Automated git worktree scripts require bash, git, grep, awk, and tr to execute properly. These dependencies handle repository synchronization, branch name substitutions, and environment file copying during the worktree setup process.