CS FundamentalsVery hardProduct-company placement · Git interview

main has commits A-B-C-D. feature was created at B and has commits E-F. How many commits do git log main..feature and git log main...feature list?

  1. A. 2 and 2
  2. B. 2 and 6
  3. C. 4 and 2
  4. D. 2 and 4

Correct answer: D. 2 and 4

main..feature lists commits reachable from feature but not from main: E and F. The three-dot form is the symmetric difference, commits on either side but not both: C, D, E and F.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic