Challenge - 5 Problems
Bisect Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Bisect Start and Marking Commits
You start a git bisect session with
git bisect start. You mark commit abc123 as bad and commit def456 as good. What is the next step git expects you to do?Attempts:
2 left
💡 Hint
Think about how git bisect narrows down the commit range step by step.
✗ Incorrect
After marking the known good and bad commits, git bisect checks out a commit in the middle. You must test it and mark it as good or bad manually. This helps git narrow down the commit that introduced the bug.
💻 Command Output
intermediate2:00remaining
Bisect Command Output Interpretation
You run
What does this output mean?
git bisect bad after testing a commit. Git outputs:Bisecting: 3 revisions left to test after this (roughly 2 steps)
Next commit to test is 789abcde
What does this output mean?
Attempts:
2 left
💡 Hint
Look at the number of revisions left and the next commit hash.
✗ Incorrect
The output shows how many commits remain to test and which commit git will check out next. It helps you understand progress.
❓ Troubleshoot
advanced2:00remaining
Bisect Session Stuck on a Commit
During a bisect session, you test a commit but the build fails and you cannot determine if it is good or bad. What is the best way to proceed?
Attempts:
2 left
💡 Hint
Think about how to handle commits that cannot be tested.
✗ Incorrect
If you cannot test a commit, skipping it allows git to ignore it and continue bisecting with other commits.
🧠 Conceptual
advanced2:00remaining
Understanding Bisect Algorithm Efficiency
Git bisect uses a binary search algorithm to find the bad commit. If you have 128 commits between good and bad, what is the maximum number of steps git bisect will take to find the bad commit?
Attempts:
2 left
💡 Hint
Binary search halves the search space each step.
✗ Incorrect
Binary search cuts the number of commits to check in half each step. For 128 commits, log2(128) = 7 steps max.
✅ Best Practice
expert2:00remaining
Automating Bisect with a Test Script
You want to automate git bisect using
git bisect run with a test script that exits 0 if the commit is good and 1 if bad. Which of the following scripts is correct for this purpose?Attempts:
2 left
💡 Hint
The script must exit 0 for good commits and non-zero for bad commits.
✗ Incorrect
The script runs tests and exits 0 if tests pass (good commit), or exits 1 if tests fail (bad commit). This matches git bisect run expectations.