git-merge-to-main

Installation
SKILL.md

Git Merge to Main

Overview

Merge the current branch into main, then delete the source branch locally because it's now fully merged. 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."

Preconditions

Run these checks before touching anything. Fail closed on any violation — report and stop.

# Check Command On fail
1 In a git repo git rev-parse --is-inside-work-tree Abort: "Not a git repository."
2 HEAD attached (not detached) git symbolic-ref -q HEAD Abort: "Detached HEAD; checkout a branch first."
3 Current branch is not main [ "$(git branch --show-current)" != "main" ] Abort: "Already on main; nothing to merge."
4 Working tree clean [ -z "$(git status --porcelain)" ] Abort: "Working tree has uncommitted changes; commit/stash first."
5 main branch exists locally git rev-parse --verify main Abort: "main branch not found locally; create it or use git-merge-to-dev."
Related skills

More from chann/skills

Installs
5
Repository
chann/skills
First Seen
6 days ago