Skip to content
Investigation

Bisect

Twenty commits, five tests.

git bisect is a binary search over history. You tell it one commit where the problem exists and one where it does not; it checks out the middle and asks you which side that is on.

Each answer halves the range, so a thousand commits take ten tests. Nobody reads a thousand diffs, which is why this is the command to reach for first rather than last.

git bisect run <command> does it without you: any command that exits zero for good and non-zero for bad will drive the whole search.

Commands in this lesson

git bisect
Binary-search history for the commit that introduced a change
No account. Everything you do stays in this browser unless you switch on sync.Part of liter8.sh · v0.5.2 · Report an issue