# Git bisect can run automated tests to find breaking commits

**Date:** 2025-12-02  
**Tags:** Git, DevTools, Debugging  
**URL:** https://kelexine.is-a.dev/til/git-bisect-automation

---

TIL: Git bisect can run automated tests to find breaking commits. 'git bisect run npm test' binary searches through history automatically. Found a regression in 300 commits in under 2 minutes.


```bash
git bisect start HEAD v1.0.0
git bisect run npm test

# Git automatically finds the first bad commit
# Exit code 0 = good, non-zero = bad
```



**Related:** [https://git-scm.com/docs/git-bisect](https://git-scm.com/docs/git-bisect)


---

*This content is available at [kelexine.is-a.dev/til/git-bisect-automation](https://kelexine.is-a.dev/til/git-bisect-automation)*
