CS FundamentalsVery hardCognizant GenC · Infosys

Branch main has commit A. Branch feature was created from A and has commits B and C. After git merge --no-ff feature on main, how many commits are on main's history?

  1. A. 3
  2. B. 2
  3. C. 4
  4. D. 5

Correct answer: C. 4

A fast-forward would give 3 commits, but --no-ff forces a merge commit, so history has A, B, C and the merge commit.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic