Git Bisect
Git bisect uses binary search to find the commit that introduced a bug. Instead of checking every commit, it efficiently narrows down the problematic commit.
How Bisect Works
- You specify a "good" commit (where the bug didn't exist)
- You specify a "bad" commit (where the bug exists)
- Git checks out a commit in the middle
- You test and mark it as good or bad
- Git narrows the search and repeats
- Eventually, Git finds the first bad commit
With binary search, finding a bug among 1000 commits takes only ~10 tests.
Starting a Bisect
From Commit History
- Find a commit you know was working (good)
- Right-click the commit
- Select Bisect from here (good)...
- Enter the bad commit (or leave empty for HEAD)
- Click Start Bisect
From the Dialog
- Open the bisect dialog from Repository menu
- Enter the good (old) commit hash
- Enter the bad (new) commit hash (optional, defaults to HEAD)
- Click Start Bisect
Testing Commits
Once bisect starts, Axis shows a banner indicating:
- The current commit being tested
- Approximate steps remaining
For each commit:
- Test if the bug exists
- Click one of:
- Mark as good - Bug not present
- Mark as bad - Bug is present
- Skip commit - Can't test this commit (e.g., won't build)
Finding the Result
When bisect completes, Axis shows the first bad commit - the one that introduced the bug.
The result includes:
- Commit hash
- Author
- Commit message
- Changed files
Ending Bisect
Click End Bisect to stop the bisect session Returns to your original branch
TIP
Always end bisect when done. Leaving a bisect session active can cause confusion.
Tips
Automate Testing
If you have automated tests, you can quickly determine good/bad status:
- Run your test suite
- Mark based on test results
Skip When Necessary
Use Skip when a commit:
- Won't compile
- Has unrelated issues
- Can't be tested for other reasons
Git will work around skipped commits.
Take Notes
Note which commits you've tested and why. This helps if you need to restart or explain findings later.
Start Wide
Choose commits far apart for good/bad. This gives bisect more room to narrow down efficiently.
Example Workflow
- Notice a bug in the current version
- Find a release tag from when the bug didn't exist
- Right-click that tag's commit → Bisect from here (good)
- Bisect starts with HEAD as bad
- Test each commit Axis checks out
- After ~7 steps (for 100 commits), find the culprit
- Review the bad commit to understand what caused the bug
- End bisect and create a fix
