What is the main reason rebasing creates a linear history in Git?
easy📝 Conceptual Q11 of 15
Git - Rebasing
What is the main reason rebasing creates a linear history in Git?
AIt creates a new branch automatically
BIt merges all branches into one commit
CIt deletes all previous commits
DIt moves your commits on top of the latest commit from the target branch
Step-by-Step Solution
Solution:
Step 1: Understand what rebasing does
Rebasing takes your commits and places them on top of another branch's latest commit, replaying them in order.
Step 2: Effect on commit history
This action removes the branching structure by making your commits appear as if they were made after the latest commit on the target branch, creating a straight line.
Final Answer:
It moves your commits on top of the latest commit from the target branch -> Option D
Quick Check:
Rebase = replay commits on top [OK]
Quick Trick:Rebase replays commits on latest branch commit [OK]
Common Mistakes:
Thinking rebase merges commits into one
Believing rebase deletes old commits
Confusing rebase with branch creation
Master "Rebasing" in Git
9 interactive learning modes - each teaches the same concept differently