On a branch drifted behind a busy main, git rebase origin/main conflicts on the first commit and again on each remaining one — 16 instead of one. Rebase an empty branch and replay the work as one uncommitted change.
| |
Reset to it: the branch’s differences return to the working tree, unstaged:
| |
Stash it; the rebase has nothing to conflict over:
| |
Resolve, commit, push:
| |
Two side effects: a squash rebase (one commit), and the original branch is gone — use git checkout -b clean-branch origin/main instead of the rebase when it matters.
The two aliases
mb returns the merge-base of the current branch, reset-to-base feeds it to reset:
| |
| |
Both are in the aliases note with the rest.