git bisect

A command that finds the commit that introduced a bug by binary search: you mark commits good or bad and Git checks out the next one to test.

In more detail

Start with git bisect start, mark the current commit bad and a known older commit good, and Git picks the commit halfway between. Each answer halves the range, so about ten tests search a thousand commits. git bisect reset returns you to where you started, and small commits make the result precise.

Examples

git bisect start
git bisect good HEAD~2

Related terms

Taught in

References

Certification courses