You can use git bisect to track in which commit a bug was introduced.
It works by proposing past commit to the user and asking for feedback (bug present or not).
It then narrow down the commit that cause the bug with binary search.
hash of a commit where the bug is not present
git log
bisect
git bisect start
hash of the good commit.
git bisect good (hash)
git bisect bad
feedback
git bisect bad
git bisect good
Note: if you made a mistake, you can change the state (good bad) of a commit: > git bisect (good bad) (hash)
Repeat step 5, when done, the commit causing the bug will be identified
After a bisect session, you need to return to a working commit.
git bisect reset
git bisect reset (hash)
| name | action |
|---|---|
| git bisect log | show what has been done, what’s marked good or bad |
Note: this process can be fully automated, and check by itself if a bug is present or not. (but how???)