Using git bisect to pinpoint bugs in your commit history

Using git bisect to pinpoint bugs in your commit history

git bisect is most useful when a bug is introduced in a codebase, but is not discovered until later.

Pinpointing which commit introduced a bug often goes a long way towards resolving it, and git bisect is the tool you can use to find the first bad commit.

You could do this by simply starting at the first commit and testing each commit in turn. However git bisect is smarter than this, and uses a binary search, which can drastically reduce the number of commits you need to check.

Avatar
Jim Hester
Software Engineer

I'm a Software Engineer at RStudio and R package developer.

Related