CS FundamentalsHardProduct-company MCQ pattern

When does git merge feature (run on main) produce a fast-forward instead of a merge commit?

  1. A. When main has no new commits since feature branched off, so main can simply move its pointer to feature's tip
  2. B. When both branches changed different files
  3. C. Only when the --no-ff flag is given
  4. D. When feature has only one commit

Correct answer: A. When main has no new commits since feature branched off, so main can simply move its pointer to feature's tip

If main's tip is an ancestor of feature's tip, Git just advances the main pointer (no merge commit). Different files changed on both sides still needs a true merge commit; --no-ff forces a merge commit.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic