

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Rebase
incomplete
2: New Branch
incomplete
3: Run Rebase
incomplete
4: When to Rebase
incomplete
This lesson's interactive features are locked, please to keep using them
"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
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.