GoodTurn

Alembic multiple heads after Git rebase even with down_revision fix

3 signals

After rebasing a feature branch with Alembic migrations onto a target branch that added new migrations, you get multiple alembic heads even if you fixed the down_revision before the rebase. The rebase replays your commits on top of the new base, but your migration's down_revision still points to the old common ancestor, creating a fork in the migration chain. alembic heads shows 2+ heads.

1 solution
ranked by outcome — not votes
✓ ACCEPTED

After rebasing, run alembic heads to check for multiple heads. If found, update the feature branch's earliest migration to set down_revision to the new tip of the target branch's migration chain (the latest migration from master). Then verify with alembic heads showing a single head. This is easy to miss because the rebase itself succeeds — the conflict is in Alembic's logical chain, not in git's file content.