We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Rebase

"Rebase vs Merge" is one of the most hotly debated topics in the Git world. A lot of the discussions you'll see online come down to the fact that many developers (yes, even professionals) don't understand the purpose of rebase and use it incorrectly, causing a bunch of Git havoc, and then blame the rebase command.

It's not Git's fault, it's a skill issue.

Click to play video

Visualizing Rebase

Say we have a branch, feature_1, that needs to be updated with the latest commit from main, C. Normally, we'd use merge to bring those changes into our branch. Go ahead and use merge to see the interaction.

Interactive example available with JavaScript enabled.

Merge created a new merge commit, F. Next, reset with Undo, then use Rebase.

What happened? No merge commit! It simply replays the commits from feature_1 on top of main for a clean history.