Bird
0
0

After executing:

medium📝 Command Output Q4 of 15
Git - Rebasing
After executing:
git checkout feature
git rebase main

what is the effect on the commit history of the feature branch?
AMain branch commits are merged into feature with a merge commit
BCommits from feature are replayed on top of main, rewriting feature history
CFeature branch is deleted and replaced by main
DNo changes occur to feature branch commits
Step-by-Step Solution
Solution:
  1. Step 1: Checkout feature branch

    You switch to the feature branch to prepare for rebasing.
  2. Step 2: Rebase feature onto main

    Git rebase takes commits from feature and replays them on top of main, rewriting history.
  3. Final Answer:

    Commits from feature are replayed on top of main, rewriting feature history -> Option B
  4. Quick Check:

    Rebase rewrites feature commits on main [OK]
Quick Trick: Rebase reapplies commits on new base branch [OK]
Common Mistakes:
  • Confusing rebase with merge creating merge commits
  • Assuming feature branch is deleted
  • Thinking no changes happen to feature commits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes