Git Bisect Finds the Commit That Broke a Test
A regression appeared after many commits and manual guessing is slow. This guide gives you a small, testable way to approach the issue before changing a live system.
A practical workflow
- Pick one known good commit and one bad commit, then define a reliable pass/fail test.
- Let git bisect narrow the range and inspect the first bad commit in context.
What to check
A flaky test can mislead bisect; stabilize the reproduction before relying on its result. Compare the result with the original problem and record what changed. If a measurement or test does not support the change, revisit the assumption rather than adding more complexity.
Keep the experiment small enough to reverse. Document the starting state, the change and the result so another person can repeat the process. Product menus and versions can change, so check the current documentation for your environment.
Official reference: Read the documentation.