My Experience with Git Bisect

03 January 2015

Git bisect is one of the most powerful features of Git that many developers overlook. It's a binary search tool that helps you find the commit that introduced a bug.

What is Git Bisect?

Git bisect helps you identify the exact commit that introduced a bug by performing a binary search through your commit history.

How to Use Git Bisect

git bisect start
git bisect bad HEAD
git bisect good v1.0
# Git will checkout a commit in the middle
# Test the code, then mark it as good or bad
git bisect good  # or git bisect bad
# Repeat until the culprit commit is found
git bisect reset

Benefits

Once you master git bisect, you'll realize how powerful it is for debugging.

← Back to Blog

About the Author

Kameshwaran Sachithanantham

Software Engineer cum Project Manager with 11+ years of experience in React, Node.js, React Native, and Ruby on Rails.