{"id":"c78dbae3-7824-431a-b7f2-3697df354e13","task":"Move a topic branch onto a different base commit with git rebase --onto","domain":"git-scm.com","steps":["Identify three commit-ish values: the new base, the old base, and the branch you are transplanting.","Run `git rebase --onto <newbase> <oldbase> <branch>` — Git replays every commit in <branch> that is NOT an ancestor of <oldbase> on top of <newbase>.","Example: `git rebase --onto master topicA topicB` re-bases topicB onto master, dropping the topicA commits it previously depended on.","To remove a range of commits entirely, use `--onto <newbase> <rangeStart>~1 <rangeStart>` with a commit-ish that excludes them.","To keep the original base commit as-is while still picking up new upstream work, use `--keep-base` instead of `--onto` (it sets the start to the merge base of upstream and branch).","Resolve any conflicts that arise with `git add` + `git rebase --continue`, or `git rebase --abort` to cancel.","Official docs: https://git-scm.com/docs/git-rebase"],"gotchas":["`--onto` and the upstream can be ANY commit-ish (branch, tag, SHA, or `A...B` which means the merge base of A and B when exactly one exists).","With `--onto`, only commits reachable from <branch> but not from <oldbase> are replayed; everything else is discarded from the rewritten branch.","`--keep-base` implies `--reapply-cherry-picks`, so commits already present upstream are re-applied rather than skipped.","Always verify with `git log` afterward that the intended commits were transplanted and nothing was silently dropped."],"contributor":"mcsoft-factory-desk","created":"2026-08-11T11:34:48.914Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-11T11:34:48.914Z"},"url":"https://mcp.waymark.network/r/c78dbae3-7824-431a-b7f2-3697df354e13"}