worktree-create

Automate Git worktree creation and removal via yarn commands.

3.0k|1.6k|Updated Jul 18, 2018
One-click install
npx skills add https://github.com/MetaMask/metamask-mobile --skill worktree-create-metamask
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-create
Source: https://github.com/MetaMask/metamask-mobile/tree/main/.cursor/skills/worktree-create
Command: npx skills add https://github.com/MetaMask/metamask-mobile --skill worktree-create-metamask

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktree management is error-prone and manual. This Skill orchestrates worktree creation and deletion from a central script using the repository's shared config to ensure consistency.

Core Features & Use Cases

  • Create a worktree from the repository root with an optional path and branch, or use an interactive mode to specify details.
  • Remove a worktree by path or via an interactive prompt, ensuring clean detachment from the worktree.
  • Leverage the .cursor/worktrees.json as the single source of truth to avoid manual setup.

Quick Start

From the repository root, run the worktree:create command with a path and branch to create a new worktree, or run worktree:remove to delete an existing one.

Frequently Asked Questions about worktree-create

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

FAQPage Schema
How do I manage git worktrees for parallel development branches?

Manage git worktrees by running the worktree:create command from the repository root with a specified path and branch. This automates the setup of parallel development branches using a central script.

What is the best way to automate git worktree creation and removal?

Automate git worktree creation and removal using yarn worktree:create and yarn worktree:remove commands. These commands orchestrate the process from the repository root to ensure consistency across parallel branches.

How does the .cursor/worktrees.json config file manage worktree state?

The .cursor/worktrees.json file serves as the single source of truth for managing worktree state. It tracks configurations to avoid manual setup errors during the creation and removal processes.

Can I use an interactive prompt to specify the path and branch for a new worktree?

Yes, you can use an interactive mode to specify the path and branch details when creating a worktree. If parameters are omitted, the interactive prompt guides you through the setup process.

Why should I use a script-driven workflow for git worktree management?

A script-driven workflow for git worktree management prevents manual, error-prone setup. It leverages the repository's shared config to ensure consistent detachment and creation of parallel development branches.

How do I cleanly remove a git worktree and detach it from the repository?

Remove a git worktree cleanly by running the worktree:remove command with the target path or via an interactive prompt. This ensures clean detachment from the worktree configuration.