Skip to content

Pin the merge method per direction, and show rebase is safe here - #8

Merged
ChrisonSimtian merged 1 commit into
developfrom
docs/merge-strategy
Aug 14, 2026
Merged

Pin the merge method per direction, and show rebase is safe here#8
ChrisonSimtian merged 1 commit into
developfrom
docs/merge-strategy

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Contributor

Settles the open question: squash into develop, rebase into main. Merge commits stay disabled.

Merging Method
feature/*develop Squash
developmain Rebase
release/* / hotfix/*main Rebase
port-back → develop Squash

GitHub can't enforce a method per branch, so this is written down rather than configured. Both methods stay enabled because both are correct somewhere. Repo settings are unchanged and already correct: merge_commit: false, squash: true, rebase: true.

Why rebase between two long-lived branches is safe

This is worth recording because it's a fair thing to worry about, and I nearly talked us out of rebase over it.

Rebase-merge rewrites commits, so main never becomes an ancestor of develop. Once a hotfix lands on main and is ported back, the merge base falls behind both — so the next release looks like it would replay commits already present on main.

It doesn't. git rebase detects already-applied commits by patch-id and drops them. Verified rather than assumed — simulated a release, a hotfix on main, and a cherry-pick back to develop:

GitHub would replay for release 2:  B, hotfix, A
RESULT: clean
  replayed: B

Three candidates, one replayed, no conflict and no duplicates.

The edge case is documented too: a port-back that was conflict-resolved differently from the original no longer matches by patch, so rebase will retry it. That surfaces as a conflict at release time — visible and fixable, not silent corruption.

Also

PR template now states the base branch and merge method, since those are the two things easiest to get wrong under GitFlow.


Incidentally this is the first PR under the new flow — feature-style branch off develop, targeting develop. Being docs-only, it should be build-skip.yml that reports the required check rather than a real build.

🤖 Generated with Claude Code

Squash into develop, rebase into main. GitHub cannot enforce a method per
branch, so this is written down rather than configured; both methods stay
enabled because both are correct somewhere.

Also records why rebasing between two long-lived branches is safe, since it
is a fair thing to worry about: rebase-merge rewrites commits, so main never
becomes an ancestor of develop, and after a hotfix has been ported back the
merge base falls behind both. The next release therefore *looks* like it
would replay commits already on main.

It doesn't — git rebase drops already-applied commits by patch-id. Verified
rather than assumed: after a release, a hotfix on main and a cherry-pick back
to develop, rebasing develop onto main listed three candidate commits and
replayed exactly one.

The edge case is documented too: a port-back that was conflict-resolved
differently no longer matches by patch, so rebase will retry it. That shows
up as a conflict at release time, which is visible and fixable rather than
silent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ChrisonSimtian ChrisonSimtian added the documentation Improvements or additions to documentation label Aug 14, 2026
@ChrisonSimtian
ChrisonSimtian merged commit 7b65b18 into develop Aug 14, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the docs/merge-strategy branch August 14, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant