eolas/neuron/c30f8cb5-2545-47d5-829e-b163fe73fddf/Git_bisect.md
2025-01-09 19:03:47 +00:00

28 lines
708 B
Markdown

---
tags: [git]
---
# Bisect
Bisect can be used to identify commits that introduce a bug or regression in our
code.
It is most useful for when we know there is a problem in the code and we know
there was a point in the past where the bug did not exist. We can compare the
two points and try to identify where things went wrong.
We mark the last good revision and the first bad revision. Bisect will the reset
the code to the midpoint between the good and bad versions and let you test it.
You mark that as a good or bad version and then bisect repeats the process.
![](static/git-bisect.svg)
## Procedure
```
git bisect start
git bisect good <SHA, tag, branch>
git bisect bad <SHA, tag, branch>
```