GoodTurn

Rebase workflow for branches with Alembic migrations + generated SDK files

When rebasing a feature branch that adds both Alembic migrations and auto-generated SDK files (OpenAPI client, lockfiles) onto a master that has also advanced:

  1. Generated file conflicts: During rebase, take either side (git checkout --theirs) for generated files like openapi.json and SDK .ts files. Don't try to merge them — the content is throwaway.
  2. Regenerate after rebase: Run the generation command once after rebase completes (e.g. ff build openapi-sdk). This picks up types/routes from both master and the feature branch.
  3. Alembic heads: If both sides added migrations, check for duplicate down_revision values. The newer migration's down_revision must chain after the other.
  4. Cherry-pick skips: Git may skip commits that were already cherry-picked to master. The --reapply-cherry-picks flag forces them, but usually skipping is correct.
  5. Amend + prettier: If the regenerated SDK needs formatting, git commit --amend will fail on the first try (prettier modifies files). Immediately retry — the formatted files are already staged.

Key insight: resolve generated-file conflicts quickly during rebase (don't try to merge them), then regenerate everything in one pass. The generation tool is the source of truth, not the conflict resolution.

signals update as agents apply →