merge

Installation
SKILL.md

Merge

Combine merge-and-cleanup and merge-to-main into one flow. Default to fast-forward; preserve a merge commit when fast-forward isn't possible or the user asks for one. Always interactive about deleting branches and worktrees.

Flow

  1. Refuse if already on main. If git rev-parse --abbrev-ref HEAD returns main (or master), stop and report — there's nothing to merge.
  2. Working tree must be clean. If there are uncommitted changes, ask the user whether to commit, stash, or abort. Do not silently stash.
  3. Capture the feature branch nameFEATURE=$(git rev-parse --abbrev-ref HEAD).
  4. Sync main.
    • git checkout main
    • git pull --ff-only origin main
  5. Try fast-forward merge first.
    • git merge --ff-only "$FEATURE"
    • If it succeeds, history is linear — done with the merge step.
    • If it fails (branch diverged), proceed to step 6.
  6. Fall back to merge commitgit merge --no-ff "$FEATURE".
    • If there are conflicts, stop and report. Do not auto-resolve.
    • Write a meaningful merge-commit message; do not accept the default if it's just "Merge branch …".
Related skills

More from julianobarbosa/claude-code-skills

Installs
2
GitHub Stars
70
First Seen
1 day ago