Git
Bisect Commands
Git bisect is a powerful debugging tool that uses binary search to find exactly which commit introduced a bug. Learn to automate bug hunting and pinpoint regressions efficiently.
6 commands
Pro Tips
Automate bisect with 'git bisect run ./test.sh' - Git will automatically find the bad commit if your script returns 0 for good, 1 for bad.
If you can't test a commit (e.g., won't compile), use 'git bisect skip' to move on without marking it good or bad.
Use 'git bisect log' to see the bisect history, helpful if you need to restart or review your progress.
Common Mistakes
Always run 'git bisect reset' when done to return to your original HEAD. Forgetting this leaves you in a detached state.