CS FundamentalsHardProduct-company MCQ pattern

main has commits A–B–C. Branch feature was created from B and has commits D–E. On feature you run git rebase main. How many of these statements are true afterwards? 1. feature now reads A–B–C–D′–E′. 2. D′ and E′ have the same commit hashes as D and E. 3. git log main..feature lists exactly 2 commits. 4. Running git merge feature on main now produces a fast-forward.

  1. A. Only one
  2. B. Only two
  3. C. Only three
  4. D. All four

Correct answer: C. Only three

1, 3 and 4 are true: rebase replays D and E on top of C, so feature is two commits ahead and main can fast-forward. 2 is false: the replayed commits have a new parent, so their hashes change even though the diffs are the same. So three are true.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic