Git Bisect

git bisect is the kind of tool you’ll use about once every six months, but when you use it, you’ll be totally thrilled that it exists.

git bisect is indicated when something has gone wrong in your code, and you believe it to be the result of a code change but you cannot isolate which change resulted in the problem. git bisect’s goal is to isolate the commit where the change occurred.

Prescription 42Use git bisect to track down mysterious failures in your code when you have no idea how they were inserted.

You start using git bisect with two commands:

 $ ​​git​​ ​​bisect​​ ​​start
 $ ​​git​​ ​​bisect​​ ​​bad

The first command puts Git into what I’ll call bisect mode, and the second command says that the current Git snapshot is bad, ...

Get Rails 5 Test Prescriptions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.