A bug appeared sometime in your last 1,000 commits. What does git bisect do?

Binary search through the history to find the commit that introduced it.

Start playing free

  1. Deletes every commit after the bug
  2. Splits the repo into two copies
  3. Binary searches the commits to find the bad one ✔

Why: You mark one commit good and one bad. Git checks out the middle one and asks you which it is, halving the range each time, so 1,000 commits take only about 10 tests.

Huh, didn't know that: Bisect is binary search applied to debugging, the same O(log n) idea as searching a sorted list.

The dad joke
Git bisect helped me find who broke the build. It was me, ten commits ago.
Like this card?
Play the game

References

Answer: Binary searches the commits to find the bad one. You mark one commit good and one bad. Git checks out the middle one and asks you which it is, halving the range each time, so 1,000 commits take only about 10 tests.

  1. Git documentation: git-bisect git-scm.com/docs/git-bisect
    This command uses a binary search algorithm to find which commit in your project’s history introduced a bug.
    Checked 2026-10-10.

Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.

Test yourself in the game