Skip to content

Rebase and merge

Dianjin Wang edited this page Feb 2, 2026 · 2 revisions

GitHub may show:

This branch cannot be rebased due to conflicts

This does NOT mean your pull request is broken. This typically happens when you have a large pull request with more than 100 commits or duplicated histories. It only affects GitHub’s UI merge method. We can merge via CLI.

Note

This workflow requires committer push access.

Background

For Apache Cloudberry release branches (e.g., REL_2_STABLE), we prefer a controlled and reproducible merge process.

Manual merging allows us to:

  • Preserve release branch stability
  • Keep CI traceability
  • Handle large PRs that GitHub UI cannot rebase automatically

Assumptions

  • Target branch: REL_2_STABLE
  • PR branch: pr-branch
  • You have push access to the Apache Cloudberry repository

Workflow

Step 1: Download the Cloudberry Source Files

git clone [email protected]:apache/cloudberry.git
cd cloudberry

Step 2: Fetch PR Branch

git fetch origin pull/pr-id/head:pr-branch
git checkout pr-branch

Rebase PR onto the target branch (Recommended. This rewrites the PR branch history. Resolve conflicts if any.):

git rebase origin/REL_2_STABLE

Step 3: Update the Target Branch

git checkout REL_2_STABLE
git pull origin REL_2_STABLE

Step 4: Merge the PR into the Release Branch

git merge pr-branch --no-ff

Step 5: Push to the Release Branch

git push origin REL_2_STABLE

References

Clone this wiki locally