How does rebasing affect the commit timeline in Git?
easy📝 Conceptual Q1 of 15
Git - Rebasing
How does rebasing affect the commit timeline in Git?
AIt merges all commits into a single commit, hiding history.
BIt reapplies commits sequentially on top of the target branch, creating a straight line.
CIt duplicates commits across branches without changing their order.
DIt deletes all previous commits and starts fresh.
Step-by-Step Solution
Solution:
Step 1: Understand rebasing
Rebasing takes the commits from the current branch and reapplies them on top of another branch sequentially.
Step 2: Effect on commit timeline
This process rewrites the commit history so that the commits appear as if they were made after the target branch's latest commit, resulting in a linear timeline.
Final Answer:
It reapplies commits sequentially on top of the target branch, creating a straight line. -> Option B
Quick Check:
Rebasing rewrites history linearly [OK]
Quick Trick:Rebase reapplies commits in order on top of target branch [OK]
Common Mistakes:
Thinking rebasing merges commits into one
Assuming rebasing duplicates commits without order change
Believing rebasing deletes previous commits
Master "Rebasing" in Git
9 interactive learning modes - each teaches the same concept differently