Some good revs are not ancestors of the bad rev. git bisect cannot work properly in this case.
The commit you marked good isn't in the history of the bad one.
Some good revs are not ancestors of the bad revgit bisect cannot work properly in this caseSome good revs are not ancestors of the bad rev. git bisect cannot work properly in this case. Maybe you mistook good and bad revs? Meaning
Bisect needs the good commit to be an ancestor. Pick a good commit on the same line of history, or merge-base the two first.
Common causes
- Good commit on another branch
- Wrong bad/good order
- Rewritten history
⚡ Quick fix
- Use
git merge-base good bad - Swap good/bad if mislabelled
git bisect resetand restart
Detailed fix by platform
Git
- bash
git bisect reset git bisect start BAD GOOD git merge-base GOOD BAD
How to diagnose
- Ancestry — good in bad history?
- Order — right?
- History — rewritten?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- actions/checkout: shallow clone, git history missing fatal: couldn't find remote ref refs/heads/x (fetch-depth: 1)
- error: Repository lacks these prerequisite commits error: Repository lacks these prerequisite commits: a1b2c3d...
- fatal: --unshallow on a complete repository does not make sense fatal: --unshallow on a complete repository does not make sense
Most viewed in Git
- Git SSL certificate problem fatal: unable to access 'https://…': SSL certificate problem: unable to get local issuer certificate
- gpg failed to sign error: gpg failed to sign the data — fatal: failed to write commit object
- workflow scope ! [remote rejected] … (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/x.yml` without `workflow` scope)
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 25 Nov 2026