Bird
0
0

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:
  1. Step 1: Understand rebasing

    Rebasing takes the commits from the current branch and reapplies them on top of another branch sequentially.
  2. 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.
  3. Final Answer:

    It reapplies commits sequentially on top of the target branch, creating a straight line. -> Option B
  4. 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

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes