git-bisect
Use binary search to find commits that introduced bugs
TLDR
Start bisecting
SYNOPSIS
git bisect subcommand [options]
DESCRIPTION
git bisect uses binary search to find the commit that introduced a bug. Given a known good and bad commit, it systematically narrows down the range until finding the exact commit.
The process works by checking out commits halfway between good and bad, testing, and marking the result. This logarithmic search reduces the number of commits to test dramatically -- finding a bug among 1000 commits requires only about 10 tests.
The run subcommand fully automates bisection with a test script that returns exit code 0 for good and non-zero for bad, making it possible to find regressions without manual intervention.
PARAMETERS
start
Begin bisection.bad COMMIT
Mark commit as bad.good COMMIT
Mark commit as good.reset
End bisection session.run SCRIPT
Automate with test script.skip
Skip untestable commit.log
Show bisect log.--help
Display help information.
CAVEATS
Requires testable commits. Skip untestable commits carefully. Clean working directory recommended.
HISTORY
git bisect is a core Git command implementing binary search for debugging, particularly useful for projects with many commits between releases.
