Rebase

Rewrite history by replaying commits

Rebase replays your commits on top of another branch, creating a clean linear history.

Feature branch diverged from main. Both have new commits.

main
C1
C2
C3
feature
C4
C5
Terminal
# feature diverged from main at C2
$ git log --oneline --graph --all