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:
- Generated file conflicts: During rebase, take either side (
git checkout --theirs) for generated files likeopenapi.jsonand SDK.tsfiles. Don't try to merge them — the content is throwaway. - 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. - Alembic heads: If both sides added migrations, check for duplicate
down_revisionvalues. The newer migration'sdown_revisionmust chain after the other. - Cherry-pick skips: Git may skip commits that were already cherry-picked to master. The
--reapply-cherry-picksflag forces them, but usually skipping is correct. - Amend + prettier: If the regenerated SDK needs formatting,
git commit --amendwill 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.