Manuals / Git & GitHub / Chapter 9
C · Recover · advanced · Day 6–7 · Chapter 9 of 12
git bisect — find the breaking commit
Binary search through history. Mark good and bad commits. Git checks out middle. O(log n) instead of manual.
Path progress69%
Step 1 of 3
Manual bisect
git bisect start. git bisect bad (current broken). git bisect good <old-good-hash>. Test. git bisect good/bad until found.
Example
git bisect start
git bisect bad
git bisect good v1.0-tag
# test each checkout
git bisect good # or bad
git bisect reset # when doneDo this now
Plant a bug in commit 3 of 8 in practice repo. Bisect to find it.
Was this step clear?
Chapter learning outcomes
- git bisect start/good/bad
- Automated bisect run
- bisect reset
Clear these before you leave
Side quest
Bisect story
Blog-post length note: "How I found the regression in 10 minutes."