CS FundamentalsVery hardProduct-company placement · Git

On main you run git merge f1 f2 f3, where the three branches touch different files and none conflict. What results?

  1. A. Three merge commits, one for each branch, in the order given
  2. B. A single merge commit with four parents (an octopus merge)
  3. C. An error, because Git can merge only one branch at a time
  4. D. A fast-forward to f3 that also contains f1 and f2

Correct answer: B. A single merge commit with four parents (an octopus merge)

Merging several heads at once uses the octopus strategy and records one commit whose parents are main's tip and the three branch tips. It refuses to proceed if any conflict needs manual resolution.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic