Interview Q&A / Git & GitHub

IntermediateQuick answer1 min readUpdated 3 Oct 2026

What if you cannot test a commit during git bisect?

SHORT ANSWER

Run git bisect skip. Git moves to a nearby commit instead. If too many are skipped, it may only narrow the bug to a range of commits rather than one.

Explain it simply

Sometimes a middle commit does not even build because of an unrelated broken change. You can neither call it good nor bad, so you tell Git to try another.

git bisect skip removes that commit from consideration and picks a neighbour. If the bad commit hides among skipped ones, Git reports a list of candidates instead of one. In a scripted run, exit code 125 does the same.

Example

bash
git bisect start
git bisect bad
git bisect good v1.0
# the checked-out commit fails to compile
git bisect skip

What to say in the interview

"git bisect skip tells Git I cannot judge this commit, and it tries a neighbour. With many skips it may return a range, not a single commit. In scripts, exit code 125 does the same job."

#git#bisect#skip

Related questions

Practise more Git & GitHub questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Git & GitHub quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.