How can we determine the commit that is the source of a bug in GIT?

In GIT we can use git bisect command to find the commit that has introduced a bug in the system.

GIT bisect command internally uses binary search algorithm to find the commit that introduced a bug.

We first tell a bad commit that contains the bug and a good commit that was present before the bug was introduced.

Then git bisect picks a commit between those two endpoints and asks us whether the selected commit is good or bad.

It continues to narrow down the range until it discovers the exact commit responsible for introducing the bug.

Read the full book at www.amazon.com
Posted in GIT, GIT Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*