DELAPARRA
Index
Color
NL
Category: Git commands

git bisect

Explained by Updated

What is git bisect?

git bisect: Use binary search to find which commit introduced a bug. git bisect finds the commit that introduced a bug by binary search. You mark one commit as good and one as bad, and Git checks out a commit halfway between them. You test it and mark it good or bad, and Git halves the range again.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about git bisect

How is git bisect used in practice?

Even with a thousand commits in between, it takes about ten steps to find the culprit. That is often far quicker than reading through changes and guessing.

What should you keep in mind with git bisect?

If you can write a script that tests for the bug and exits with an error code when it is present, git bisect run ./test.sh does the whole search automatically. Bisect works best when every commit builds and runs, which is one more reason to keep commits small and complete. When you are done, git bisect reset returns you to where you started.

At a glance

CategoryGit commands
Explained by
Updated

More Git commands terms

All terms starting with G

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.