Guided Notes

Rebasing & Cherry-picking

Replaying commits with rebase, interactive rebase, the golden rule, cherry-pick, and patches.

What rebase does

Slide 1 / 5

git rebase main takes the commits on your current branch and replays them, one by one, on top of main's latest commit.

The result is as if you'd started your branch from today's main: a straight, linear history with no merge commit.

The replayed commits are new commits with new hashes β€” the originals are left behind (and still recoverable through the reflog).

← Undoing Changes