Git Tips Slides
PageUp x2: previous · PageDown x2: next · Home: index

git bisect

git bisect is a great tool in combination with unit tests. It makes it easy to find the commit that introduced a bug. Unfortunately, it is not a one-liner. You can use it like this:

user@host> git bisect start HEAD HEAD~10


user@host> git bisect run py.test -k test_something
 ...
c8bed9b56861ea626833637e11a216555d7e7414 is the first bad commit
Author: ...

But if your pull requests get tested before they get merged in continuous integration, you hardly need git bisect.