Skip to content

Instantly share code, notes, and snippets.

@copyleftdev
Created May 25, 2026 20:20
Show Gist options
  • Select an option

  • Save copyleftdev/8cd2236f4f23e13ba38f4a3f5ffe029e to your computer and use it in GitHub Desktop.

Select an option

Save copyleftdev/8cd2236f4f23e13ba38f4a3f5ffe029e to your computer and use it in GitHub Desktop.
git bisect run — automated binary search for a regression
# git bisect — binary search your blame
# Manual mode: you tell git good/bad at each step.
git bisect start
git bisect bad # current commit is broken
git bisect good v2.3.0 # this tag was clean
# git checks out the midpoint — test, then:
git bisect good # or: git bisect bad
# repeat ~7 times until git prints the culprit
git bisect reset # back to HEAD when done
# ── Automated mode (the real power) ──────────────────────────
# Any command that exits 0 (pass) or non-zero (fail) works as oracle.
git bisect start
git bisect bad HEAD
git bisect good v2.3.0
git bisect run python3 tests/test_regression.py
git bisect reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment