Jé pa l'temps #12 - Quickly find a bug using git bisect

Git bisect is an useful command that helps you to quickly find a bug by dichotomy

Usage

git bisect start

Target a bad commit, usually it is HEAD (because you just realized your code is bugged)

git bisect bad HEAD

Then, give a good commit where you code works as you expect

git bisect good 429761c # Exemple of a hash commit

All is setup ! Now, you just have to test your code and then tell to git if the code is good or not.

If your code is good, write git bisect good. Else, write git bisect bad.

Continue until git finds the commit which brought about the regresssion.

— — — — — — — — — — — — — — — — — — — — — —

La série « Jé pa l’temps » est une série de tutoriels rapides en mode “prise de note” pour avoir une trace de tout ce dont je ne peux me rappeler et pourquoi pas le partager à d’autre. On va à l’essentiel, laissons les jolis pavés à d’autres sites comme medium… LOL !