Something broke — but when? Instead of checking every commit, git bisect uses binary search to find the exact guilty commit in just a few steps.
You have 16 commits. The bug is somewhere in the middle.
Checking all 16 would take ages.
Binary search: Git checks the middle commit.
You tell it: GOOD or BAD.
Git cuts the search space in half. Repeat. In just 4 steps,
you find the exact buggy commit out of 16. That's log₂(16) = 4.
Out of 16 commits, you found the guilty one in just 4 steps.
That's the power of binary search — O(log n).
In a real project with 1000 commits, bisect would find the bug
in just ~10 steps instead of checking all 1000.
Pro tip: you can even automate bisect with a test script —
git bisect run ./test.sh
runs the entire search automatically.