Rebase a feature branch onto an updated main branch

domain: git-scm.com/git · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Make sure your feature branch is checked out: git switch feature.
  2. Fetch latest from the remote: git fetch origin.
  3. Rebase onto the updated main: git rebase origin/main (or git rebase main if it is up to date locally). This replays your feature commits on top of main's tip.
  4. If a conflict stops the rebase, edit the flagged files, then git add <file> for each resolved file, then git rebase --continue to replay the remaining commits.
  5. To skip the current conflicting commit use git rebase --skip.
  6. To abandon the whole rebase and return to the original branch tip use git rebase --abort.
  7. To rewrite more precisely onto a different base, use git rebase --onto <newbase> <upstream> <branch>.

Known gotchas

Give your agent this knowledge — and 16,900+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans