brandonocasey

worktree

"Create, reuse, or remove isolated Git worktrees before branch work."

brandonocasey 0 Updated 1w ago

Resources

1
GitHub

Install

npx skillscat add brandonocasey/dotfiles/worktree

Install via the SkillsCat registry.

SKILL.md

Do branch work in a worktree. Never switch branches in the main checkout.
<main-checkout> below is the first worktree entry of
git worktree list --porcelain. It is not land's MAIN_WT, which can be
unset when the target branch is checked out nowhere.

Create

Before creating or attaching a worktree, read create.md.

Prepare

Before checks or commits that require setup, read prepare.md.

Recover changes made in the main checkout

If this task already changed files in the main checkout, read
recover-main-checkout.md before moving them.

Restore a removed worktree

Before restoring a removed worktree, read restore.md.

Remove

Before removing a worktree or branch, read remove.md.
It owns cleanup eligibility, preservation checks, and removal after push.
Batch cleanup runs only when the user invokes worktree-cleanup or disk-cleanup.

After Remove, read removal-checks.md:
Submodules for initialized submodules, Blocked removal when ordinary removal fails.