How to Find a Bad Commit With git bisect
git bisect performs a binary search through your commit history to find exactly which commit introduced a bug.
Published September 28, 2026
git bisect performs a binary search through your commit history to find exactly which commit introduced a bug.
Key points
- Start with git bisect start, then mark a known-bad commit (git bisect bad) and a known-good one (git bisect good <commit>)
- Git checks out a commit halfway between the two — test it and mark it good or bad, and Git narrows the range each time
- Run git bisect reset when finished to return to your original branch
Example
git bisect start\ngit bisect bad\ngit bisect good v1.0.0