CS FundamentalsHardGATE CS · TCS NQT Prime · Product Company SDE

What is `git bisect` used for?

  1. A. Comparing two remote repositories' histories
  2. B. Splitting a single commit into two separate commits
  3. C. Automating a binary search through commit history to find the exact commit that introduced a bug, given a known-good and a known-bad commit
  4. D. Merging two unrelated repositories into one

Correct answer: C. Automating a binary search through commit history to find the exact commit that introduced a bug, given a known-good and a known-bad commit

git bisect checks out a sequence of commits chosen by binary search between a known-good and known-bad point, with the user (or a test script) marking each as good or bad, quickly narrowing down the exact offending commit.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic