Bisect
Flow
From the commit that is not working,
- run
git bisect start
- run
git bisect bad
to indicate the current commit is "bad" - run
git bisect good <SHA>
on a commit we know works- git will checkout a commit in the middle of the good-bad range
- run
git bisect good
/git bisect bad
, depending on if this middle commit works or not- repeat until we find the commit that introduced the issue
- run
git bisect reset
to clean up bisection state, returning to original HEAD
you can pass git-bisect a script which programmatically tests a tree for the presence of a bug and avoid false positives