Bird
0
0

You have a feature branch with commits A-B-C diverged from main. After running git rebase main on your feature branch, what happens?

medium📝 Predict Output Q4 of 15
Git - Rebasing
You have a feature branch with commits A-B-C diverged from main. After running git rebase main on your feature branch, what happens?
ACommits A-B-C are replayed on top of the latest main branch commits
BA merge commit is created combining feature and main branches
CThe feature branch is deleted and replaced by main
DThe main branch is reset to the feature branch commits
Step-by-Step Solution
Solution:
  1. Step 1: Understand git rebase effect

    Git rebase moves the base of the feature branch to the tip of main, replaying commits A-B-C on top.
  2. Step 2: Eliminate incorrect options

    No merge commit is created, branches are not deleted or reset by rebase.
  3. Final Answer:

    Commits A-B-C are replayed on top of the latest main branch commits -> Option A
  4. Quick Check:

    Rebase replays commits = D [OK]
Quick Trick: Rebase replays commits on new base [OK]
Common Mistakes:
  • Thinking rebase creates merge commits
  • Believing rebase deletes branches
  • Confusing rebase with branch reset

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes