name: git-bisect
description: Binary search git history to find when a bug was introduced — git bisect run automation, good/bad commit marking, regression hunting. Use when you know something broke but not which commit caused it.
license: MIT
What I do
Find exact commit that introduced a bug using binary search (O(log n) steps).
How It Works
Mark current HEAD as bad
Mark known good commit
Git checks middle commit
Test and mark good/bad
Repeat until found
Basic Workflow
Start
git bisect start
git bisect bad # HEAD is bad
git bisect good v1.0.0 # Known good
Test
# Run test
cargo test
# Mark result
git bisect bad # Bug exists
git bisect good # Bug doesn't exist
Result
a1b2c3d is the first bad commit
End
git bisect reset
Automated
git bisect start HEAD v1.0.0
git bisect run cargo test
---
name: git-bisect
description: Binary search git history to find when a bug was introduced — git bisect run automation, good/bad commit marking, regression hunting. Use when you know something broke but not which commit caused it.
license: MIT
---
## What I doFind exact commit that introduced a bug using binary search (O(log n) steps).
## How It Works1. Mark current HEAD as bad
2. Mark known good commit
3. Git checks middle commit
4. Test and mark good/bad
5. Repeat until found
## Basic Workflow### Start```bashgit bisect start
git bisect bad # HEAD is badgit bisect good v1.0.0 # Known good```
### Test```bash# Run testcargo test
# Mark resultgit bisect bad # Bug existsgit bisect good # Bug doesn't exist```
### Result```
a1b2c3d is the first bad commit
```
### End```bashgit bisect reset
```
## Automated```bashgit bisect start HEAD v1.0.0
git bisect run cargo test
```
## Advanced### Skip Uncompilable Commits```bashgit bisect skip
```
### Custom Terms```bashgit bisect start --term-old=fixed --term-new=broken
```
### After Finding```bashgit show a1b2c3d # Show diffgit blame a1b2c3d -- file.rs # Find line```
## Best Practices- [ ] Clean working directory
- [ ] Use automated tests
- [ ] Skip uncompilable commits
- [ ] Examine changes after finding
## Quick Reference```bashgit bisect start
git bisect bad
git bisect good <commit>git bisect run <command>git bisect skip
git bisect reset
```
---
Use to quickly find bug introduction point.