Find a Regression With git bisect
Binary-search history by marking commits good or bad.
Run git bisect start, then mark the current commit bad and a known-good tag with git bisect good.
01Command
Command
$ git bisect start && git bisect bad && git bisect good v1.002What it does
bisect checks out commits between the known-good and known-bad points and waits for you to test, halving the range each time. On a long history this finds the culprit in a few minutes where manual inspection would take hours, and it can be scripted with git bisect run.
03Risk
!Warning: Testing may require building or running code from arbitrary commits; be aware of untrusted build scripts.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- git-bisect documentationEvidence: Documents git bisect, which binary-searches history to find a bad commit.
Last verified: 2026-10-13 · Category: Developer