📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Git & GitHub Git Bisect

Git Bisect

4 min read Quiz at the end
Use git bisect binary search to find exactly which commit introduced a regression bug.

Git Bisect — Find the Bug Commit

# Binary search through commits to find which one introduced a bug
git bisect start
git bisect bad                  # current commit is broken
git bisect good v1.0            # v1.0 was working

# Git checks out midpoint commit automatically
# Test it, then mark:
git bisect bad   # if broken
git bisect good  # if working
# Repeat until Git identifies the culprit commit

# Automate with a test script
git bisect run npm test

# Reset when done
git bisect reset

# Result: Git tells you exactly which commit introduced the bug
Topic Quiz · 1 questions

Test your understanding before moving on

1. In git bisect, what does marking a commit as good mean?
💡 Good means the bug was not present in this commit; bad means it was. Git bisects to the culprit.