Skip to content

Rebase

What is Rebase?

A rebase moves a series of commits onto a new base commit, rewriting them so the branch history reads as if the work started from that point. It produces a linear history instead of a merge commit.

A method of integrating changes from one branch to another by moving or combining a sequence of commits to a new base commit.

Rebasing rewrites commit history by taking the commits from your current branch and reapplying them directly on top of another branch. This creates a clean, linear project history without the extra "merge commits" that standard merging creates. It is powerful but can be destructive if used on shared public branches.

How it relates to Orbit

A rebase rewrites commit history, so it is done deliberately from your own terminal; Orbit’s Git tab helps afterwards by warning about local commits missing from the remote. See Git Tab & Recovery for details.

When you would use it

You use rebase to clean up your local commit history or to catch up with the main branch's updates before submitting your code for review.

Common operations

  • Updating a feature branch with the latest changes from the main branch.
  • Squashing multiple small commits into a single cohesive commit before a pull request.

Frequently asked questions

Should I rebase or merge?

Rebase a private branch to keep history tidy; merge shared branches, because rebasing rewrites commits other people may already have.

What if a rebase goes wrong?

git rebase --abort returns to where you started, and git reflog finds earlier commits. Orbit’s Git tab also warns about local commits that never reached the remote. See Git Tab & Recovery.

Related terms

Where this is taught

No learning path uses this term yet. Browse the Learning Atlas for guided sequences through related ideas.

Going deeper