Small, Fast, & Simple

March 19, 2015

Git Bisect


Git includes the bisect command, which performs a binary search between two commits to find when a problem was introduced.

git bisect start bad-commit good-commit

Git then updates the working directory to a revision between the given commits. Tell git whether the current revision is good or bad with git bisect good or git bisect bad. Git will then update to another commit and repeat the process. Git can run the search automatically using a script that returns particular exit codes for good and bad revisions.

git bisect start bad-commit good-commit
git bisect run test-script arguments