# Some good revs are not ancestors of the bad rev. git bisect cannot work properly in this case.

**Code:** `git bisect: some good revs are not ancestors of the bad rev` · **Category:** Git · **Seen on:** Git

The commit you marked good isn't in the history of the bad one.

## 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

1. Use `git merge-base good bad`
2. Swap good/bad if mislabelled
3. `git bisect reset` and restart

## Detailed fix by platform

### Git

1. 

```bash
git bisect reset
git bisect start BAD GOOD
git merge-base GOOD BAD
```


## How to diagnose

1. **Ancestry** — good in bad history?
2. **Order** — right?
3. **History** — rewritten?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/git/bisect-no-bad-commit)
