Someone walks into an interview, gets asked the difference between merge and rebase, and has nothing. Could you give the definitive answer? Not just "merge adds a commit, rebase rewrites history," but the version that shows you actually understand what's happening underneath?
This video builds that answer from the ground up: source branch vs. target branch, what merge and rebase each do to your history, and the details most explanations skip — squash merges, author dates vs. committer dates, force-with-lease, and the one rule you never break.
This is Part 2 of a two-part series. Part 1 covers how Git actually works under the hood — pointers, linked lists, and branch diagrams:
🎬 • How Git Actually Works: Pointers, Commits,...
What we cover:
• Source branch vs. target branch — get these straight first
• Merge: how it records the join with a two-parent commit
• Rebase: how it replays commits with brand-new IDs
• Why rebase isn't done until you merge (fast-forward)
• The "below the waterline" rule
• --force vs. --force-with-lease
• Squash merge: what you gain and what you silently lose
• When to use merge, rebase, squash, or a refresh merge
• The panic question: I already pushed, then rebased — now what?
Ben Day is an independent consultant and 20-time Microsoft MVP specializing in software delivery, Azure DevOps, and GitHub. Author of "Azure Cosmos DB for .NET Developers."
🔗 https://benday.com
🔗 https://honestcheetah.com
📖 https://a.co/d/0dYOd6D8
#git #gitmerge #gitrebase #programming #softwaredevelopment
0:00 Git Merge vs. Rebase: The Definitive Interview Answer
0:26 What We'll Cover
0:59 Source and Target: Get These Straight First
1:26 Merge: Record the Join
2:12 Merge: The Commands
2:29 Rebase: Replay for a Straight Line
3:18 The One-Liner That Ties It Together
3:54 Rebase Isn't Done Yet
4:30 Why the Dates Look Wrong After a Rebase
4:59 This Is Where People Get Burned
5:06 The One Rule You Never Break
5:39 "Below the Waterline"
6:08 If You Must Force-Push
6:47 The Third Option: Squash
7:20 When Would You Use Each?
7:45 Starting from What You Need
8:28 Don't Forget the Humble Refresh Merge
9:10 Q: I Already Pushed, Then Rebased. Now What?
9:37 The Definitive Answer, in One Breath
10:14 Thanks for Watching