-
Notifications
You must be signed in to change notification settings - Fork 207
Rebase and merge
Dianjin Wang edited this page Mar 13, 2026
·
4 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.
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
- Target branch:
REL_2_STABLE - PR branch:
pr-branch - You have push access to the Apache Cloudberry repository
git clone git@github.com:apache/cloudberry.git
cd cloudberrygit fetch origin pull/pr-id/head:pr-branch
git checkout pr-branchRebase PR onto the target branch (Recommended. This rewrites the PR branch history. Resolve conflicts if any.):
git rebase origin/REL_2_STABLEgit checkout REL_2_STABLE
git pull origin REL_2_STABLEgit merge --ff-only pr-branchBefore pushing to the remote repository, perform a final check to ensure the local REL_2_STABLE is clean and contains no merge commits.
# 1. Ensure no merge commits exist in the commits about to be pushed
# Expected output: EMPTY
git rev-list --merges origin/REL_2_STABLE..HEAD
# 2. Verify the local branch is ahead of origin/REL_2_STABLE and linearly integrated
# Expected output: "Ready to push"
git merge-base --is-ancestor origin/REL_2_STABLE HEAD && echo "Ready to push"git push origin REL_2_STABLE