Count an integrated history

A team has six commits shared by main and search. After that shared history, main has three additional commits and search has five different additional commits, as shown. There are no other commits or parent links. A developer completes an ordinary two-parent merge of search into main, creating one new merge commit.


Report how many commits search was ahead of main before merging, how many it was behind, and how many distinct commits are reachable from main afterward, including its tip. Give all three answers as whole numbers of commits.


Six shared commits lead to three later commits on main and five later commits on search.


Your answers

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: