Fast-forward after an earlier integration

A developer starts main and feature at C. Main advances through M1 to M2. Feature advances through F1 to F2, merges main to create J with parents F2 and M2, and then records F3. Main remains at M2 throughout these feature operations. The diagram shows every later commit and parent link.


With no pending file changes, the developer switches to main and runs git merge --ff-only feature. Assume no hooks or other operations create commits. How many new commits does this final command create? Answer as a whole number of commits.


Feature contains a merge J that joins F2 and the current main tip M2, followed by F3.


Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Branches Questions: