lgnh-rebase-worktrees
Installation
SKILL.md
Rebase Worktrees
Rebase all non-main git worktrees onto a target branch, run package installs, and synchronize .env keys.
Arguments
- target branch (optional): Branch to rebase onto. If omitted, use the main worktree's current branch.
Execution Steps
Step 1: Collect Worktree Information
Run git worktree list --porcelain to gather all worktrees. Identify the main worktree (the first entry, which has no branch line prefixed with a worktree path containing .claude/worktrees/). Record the main worktree path and its branch.
Exclude the main worktree from the rebase targets. If no other worktrees exist, inform the user and stop.