Command Reference

git bisect

Use binary search across history to locate the commit that introduced a regression, making it one of the most valuable debugging commands in Git.

git bisect helps you find the first bad commit by repeatedly cutting the search space in half.

Basic flow

git bisect start
git bisect bad
git bisect good <good-commit>

Git then checks out midpoint commits and asks you to classify them as good or bad until the culprit is isolated.

Best use cases

  • regressions with a clear good/bad outcome
  • large history ranges that are too expensive to inspect manually
  • bugs with a reproducible test or verification step

Important caution

Because bisect moves through many commits, always end with:

git bisect reset

The command is most powerful when your test step is stable and repeatable.