Using git bisect

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:05
    One of the more powerful tools in Git is the git bisect command.
  • 0:09
    It's a command that allows us to perform a binary search
  • 0:12
    on a range of commits in our repository
  • 0:14
    in order to track down which commit introduced a bug.
  • 0:18
    In this lesson we're going to take a look at using the git bisect command
  • 0:22
    in order to track down a bug by specifying a starting and an ending commit
  • 0:28
    and then allowing the git bisect command to check out the commit
  • 0:31
    that is in between those two, allow us to view our application and see if it's working,
  • 0:38
    and then mark whether that state is good or bad
  • 0:41
    and then continue this process until Git has narrowed it down to a single commit.
Loading ...

Using Git Bisect


In this lesson we're going to use the `git bisect` command to do a little bit of debugging. We're all human, and sometimes bugs get introduced our software and we may not notice them for a while. Especially on fast moving projects. A good example of this would be a performance regression, and now you want to figure out what commit made everything run slower all of a sudden. Bisect allows us to do a binary search between a known good commit and a known bad commit and quickly narrow down which commit introducted the problem. From there it's much easier to figure out what exactly the problem is and fix it.

Additional resources: