merge-main-cleanup
Installation
SKILL.md
Merge Main Cleanup
Overview
Perform a full merge into main and then delete all other branches locally and on the default remote. Remove any worktrees tied to deleted branches.
When to Use
- User says to merge into main and keep only main.
- User wants a one-step cleanup of branches after merge.
Workflow
1) Validate repository state
- Run
git status --porcelainand stop if there are uncommitted changes. - Run
git rev-parse --show-topleveland work from that root. - Run
git fetch --all --pruneto sync branch state.
2) Determine base branch
- Prefer
main; if missing, usemaster. - Command:
git branch --list main master