Promoting dev to main
Core rule
Merge dev → main release PRs with a merge commit. Never squash or rebase
these promotions.
Ordinary contribution PRs still target dev and may be squash-merged. The
release promotion is the exception because main must retain dev in its
ancestry. Squashing a promotion makes the next release re-present old commits
and can create large false conflicts.
Workflow
Confirm the PR is exactly
base=main,head=devand no duplicate release PR is open.Review
main..dev, required CI, and deployment checks.In GitHub, open the merge-method dropdown and choose Create a merge commit. With the CLI, use:
gh pr merge <number> --repo Human-Agent-Society/CORAL --mergeKeep the long-lived
devbranch. Do not delete or force-push it.Fetch both branches and verify the released
devtip is an ancestor ofmain:git fetch origin dev main git merge-base --is-ancestor origin/dev origin/mainExit status
0is required.Confirm post-merge CI, release automation, deployments, and production smoke checks.
If GitHub reports conflicts
Do not force-rebase the shared dev branch. First inspect the topology and
reproduce conflicts with git merge-tree.
If an earlier release was squash-merged, main may have the same tree as an
earlier dev commit without sharing its ancestry. Verify tree equivalence
before choosing a repair. Prefer merging main back into dev and pushing
normally; use an ancestry-only ours merge only when exact tree equality
proves main contains no unique content to preserve.
Red flags
- GitHub's primary button says Squash and merge.
- A command uses
--squash,--rebase, or a force-push. - The release workflow proposes deleting
dev. - Conflict resolution starts before checking commit topology and tree equality.
Stop when any red flag appears and return to the workflow above.
Quick reference
| PR | Allowed merge method |
|---|---|
Feature/fix/docs branch → dev |
Repository default; usually squash |
dev → main release promotion |
Merge commit only |