git-merge-to-main
Git Merge to Main
Overview
Merge the current branch into main, then delete the source branch locally because it's now fully merged, unless the source is protected. Safe by design — never --force, never -D (only -d), never auto-resolves conflicts, never auto-pushes.
Announce at start: "I'm using the git-merge-to-main skill to merge <source-branch> into main and delete it unless it is protected."
Protected Source Branches
The following source branch names are protected and must be kept locally after the merge:
main, master, dev, develop, development, stg, stage, staging, root
If src is a protected source branch, still show the merge plan and proceed after confirmation, but skip the local delete step. Do not run git branch -d "$src" for protected branches, and do not suggest remote deletion for them.
Preconditions
Run these checks before touching anything. Fail closed on any violation — report and stop.