Uses a binary search algorithm and a given script to find which commit in history introduced a bug.
git bisect startto start the process.
git bisect good <commit>to mark a
<commit>as "good", indicating it is known to be bug-free.
git bisect bad <commit>to mark a different
<commit>as "bad" indicating it has the bug.
git bisect run <command>to run the given
<command>on each subsequent commit to find which commit introduce the bug.
git bisect resetto reset to the original branch. You can optionally specify a
<commit>to reset to.
git bisect start git bisect good <commit> git bisect bad <commit> git bisect run <command> git bisect reset [<commit>]
git bisect start git bisect good 3050fc0de git bisect bad c191f90c7 git bisect run npm test # Run `npm test` for each commit # ... some time later the bad commit will be printed git bisect reset # Goes to the original branch
Would you like to help us improve 30 seconds of code?Take a quick survey