![]() |
VOOZH | about |
git bisect helps identify the exact commit that introduced a bug by efficiently searching through commit history.
Assume a repository contains a regression. The following steps outline the technical procedure for using git bisect to identify the faulty commit:
Initialize the bisect session:
git bisect startAssume HEAD is the bad commit.
git bisect badSpecify a commit where the bug did not exist:
git bisect good <good_commit_hash>./run-tests.sh git bisect badgit bisect goodGit will continue to provide you with commits to test. Follow the previous step until you see a message indicating which commit introduced the bug.
Output:
git bisect efficiently finds the commit that introduced a bug by using binary search, making debugging faster and more manageable in large projects.