CS FundamentalsHardProduct-company placement · Git

main receives feature work only through merge commits (git merge --no-ff), plus a few direct hotfix commits. What does git log --first-parent main show?

  1. A. Every commit reachable from main, listed in plain date order
  2. B. Only the merge commits on main, leaving out the direct hotfixes
  3. C. Hotfixes and merge commits on main, not the merged branches' commits
  4. D. Only the commits whose author is recorded as the branch maintainer

Correct answer: C. Hotfixes and merge commits on main, not the merged branches' commits

--first-parent follows only each commit's first parent, which on main is the previous main tip, so the walk skips the feature commits brought in through second parents. It gives a clean 'what landed on main' history.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic