git bisect start
git bisect bad # the current commit is broken
git bisect good v2.3.0 # this one was fine
Git checks out the middle commit. Test it, then tell git:
git bisect good # or
git bisect bad
Repeat until it names the first bad commit. Then:
git bisect reset
If a script can tell good from bad (exit 0 for good), let git do the whole thing:
git bisect run npm test
Works with any command, git bisect run ./check.sh included. It's also a great argument for small commits: a bisect that lands on a 3,000-line commit hasn't told you much.