How do you find a commit which broke something after a merge operation?
Answer»
This can be a time-consuming process if we are not sure what to look at exactly. Fortunately, git provides a GREAT search facility that works on the principle of binary search as git-bisect command.
The initial set up is as follows:
git bisect START # initiates bisecting sessiongit bisect bad # MARKS current revision as badgit bisect good revision # marks last known commit as good revision
Upon RUNNING the above commands, git checks out a revision that is labeled as halfway between “good” and “bad” versions. This step can be run again by marking the commit as “good” or “bad” and the process continues until the commit which has a BUG is found.