worktree

Create a dedicated git worktree with a branch prefix for feature development.

45|3|Updated Jul 10, 2023
One-click install
npx skills add https://github.com/incubateur-ademe/benefriches --skill worktree-incubateur-ademe
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/incubateur-ademe/benefriches/tree/main/.claude/skills/worktree
Command: npx skills add https://github.com/incubateur-ademe/benefriches --skill worktree-incubateur-ademe

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Create a dedicated git worktree and prime the development environment for a new feature or refactor.

Core Features & Use Cases

  • Create a new worktree for a feature or refactor with an assigned branch prefix (feat/, refactor/, fix/, or chore/).
  • Detect whether the target branch is new or existing and adapt behavior accordingly.
  • Provide guidance on next steps and how to navigate to the worktree directory for immediate development sessions.

Quick Start

Run the script to create a worktree for a feature named "my-feature": ./scripts/create-worktree.sh my-feature --new-branch The tool will report the worktree path and remind you how to navigate to it and start a Claude Code session in that directory.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I create a git worktree for starting a new feature?▼

To create a git worktree, run the create-worktree.sh script with your feature name and the --new-branch flag to generate an isolated branch and working directory for immediate feature development.

What is the best way to manage isolated git branches for refactoring?▼

Using a git worktree is the best way to manage isolated branches for refactoring, allowing you to maintain a clean branch prefix like refactor/ and navigate directly to the dedicated worktree directory.

Can I use an existing branch when setting up a git worktree?▼

Yes, the worktree creation script detects whether the target branch is new or existing and adapts its behavior accordingly to check out your current branch into an isolated working directory.

Do I need a specific Git installation to spin up a worktree?▼

You need a working Git installation to spin up a worktree, as the script parses arguments and generates branch names using standard git worktree commands for environment setup.

How do I start a development session after generating a git worktree?▼

After generating a git worktree, the script reports the worktree path so you can navigate to that directory and start a development session immediately in the isolated environment.

What branch prefixes can I assign when creating a worktree?▼

When creating a worktree, you can assign branch prefixes such as feat/, refactor/, fix/, or chore/ to organize isolated feature development and clean branch management.