git bisect (start
git bisect (start | good | bad | skip | run | log | reset)
Risk: Careful
What it does
Finds the commit that broke something by halving the history.
When to use it
When it worked before and you don't know which commit broke it.
Example
$ git bisect start HEAD HEAD~9Bad is HEAD, good is nine commits back. Git checks out the middle.
$ git bisect goodThe commit you are testing works.
$ git bisect badThe commit you are testing is broken.
$ git bisect run sh test.shLet a test script judge every step for you.
$ git bisect resetFinish and go back to your branch.
Learn it in: Find the bug with bisect · Official docs