Skip to content

Rebase vs merge

Merge preserves both histories with a bubble, rebase rewrites one onto the other for a line; merge is safe for shared branches, rebase is not.

Aspect

Merge

Rebase

History shape

Bubble (two parents)

Linear

Hashes of commits

Preserved

Rewritten

Safe on shared branches

Yes

No

Conflicts

Once at merge

Per replayed commit

Audit trail

Full

Simplified

Typical use

main ← feature

feature → main