Bird
0
0

After merging a feature branch into main using git merge --no-ff, what will the commit history show?

medium📝 Predict Output Q5 of 15
Git - Rebasing
After merging a feature branch into main using git merge --no-ff, what will the commit history show?
AA linear history with feature commits directly on main
BA merge commit connecting feature branch commits to main
CFeature branch commits deleted from history
DMain branch reset to feature branch state
Step-by-Step Solution
Solution:
  1. Step 1: Understand --no-ff merge

    The --no-ff flag forces creation of a merge commit even if fast-forward is possible.
  2. Step 2: Identify commit history effect

    This results in a merge commit connecting feature branch commits to main, preserving branch structure.
  3. Final Answer:

    A merge commit connecting feature branch commits to main -> Option B
  4. Quick Check:

    --no-ff creates merge commit = B [OK]
Quick Trick: Use --no-ff to keep merge commits [OK]
Common Mistakes:
  • Expecting linear history with --no-ff
  • Thinking commits get deleted
  • Confusing reset with merge

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes