rbm
Purpose
Rebase current work onto a target branch safely, with smart context gathering and strict guardrails.
Defaults
- •Intended for non-
mainfeature branches. - •Gather intent from commit history and diffs before rebasing.
- •On conflicts, stop and ask user (do not auto-resolve).
- •After successful history rewrite on non-
main, auto-push with--force-with-lease.
Workflow
- •Confirm:
- •current branch (
git branch --show-current) is notmain - •target branch is provided by user
- •current branch (
- •Check cleanliness with
git status.- •If dirty, ask user whether to stash/commit first.
- •Gather intent context:
- •
git log --oneline <target>...HEAD - •
git diff <target>...HEAD - •If available, review related PR title/body for branch intent
- •
- •Sync refs:
- •
git fetch origin
- •
- •Rebase onto target:
- •Prefer
git rebase origin/<target> - •Use
--ontoonly when user asks or topology requires it
- •Prefer
- •If conflicts occur:
- •Stop immediately
- •Report conflicting files and conflict summary
- •Ask user how to resolve before continuing
- •If rebase succeeds and branch is non-
main:- •
git push --force-with-lease
- •
Safety Rails
- •Never run rebase on
main. - •Never auto-resolve merge conflicts.
- •Never use plain
--force; use only--force-with-lease. - •If branch protection rejects force-push, stop and ask user.