Git Bisect project with Git Submodules

The standard git bisect command helps quickly identify a specific commit that introduced a bug in a Git repository. In projects where branches with lots of commits were previously merged, there may be known-bad commits with build failure unrelated to the current bisect search. It’s possible to skip such commits during the bisect process, or avoid specific commits altogether.

For projects using Git submodules it’s useful to set option submodules.recurse true

git config --global submodule.recurse true

that works for most Git commands and avoids the need during “git bisect” to also have to “git submodule update –init –recursive” at each step of the bisect process.

git bisect start

# if you already know this current commit is good or bad, tell Git about it
git bisect <good|bad> <commit>

# test the current commit by running your test code / program / script
git bisect run <test command>

# ... repeat the above two steps until Git finds the first bad commit

# finish the bisect process and return to the original branch
git bisect reset