Merge Worktree
Use this skill for safe worktree merge and cleanup. Skip RIPER-5 mode routing for this operational task.
Workflow
- Confirm the current path is a worktree, not the main checkout.
- Run
git status --shortand stop if there are uncommitted changes. - Capture the current branch and worktree path.
- Locate the main checkout with
git worktree list. - Switch to the main checkout and update
mainif the user wants latest remote changes included. - Merge the worktree branch into
main. - If merge succeeds, remove the worktree with
git worktree remove <path>. - Delete the local branch with
git branch -d <branch>. - Run
git worktree prune. - Report the merge result and whether a push is still needed.
Safety
- Never run from
mainormaster. - Never delete a branch before a successful merge.
- Stop on conflicts and explain the exact recovery state.