This branch cannot be rebased due to too many changes

Viewed 46

I am migrating my Gerrit repository into GitHub. The repository has around 10,000 commits and I want to migrate the commit history too into GitHub. To make this work I have carried out the following steps:-

  1. Changed the remote URL of the Gerrit repo to point at the empty GitHub repo - git remote set-url origin https://github.com/myorg/myproject.git

  2. Created a replica of the master branch locally - git checkout -b MasterReplica

  3. Merged origin/main branch into MasterReplica branch allowing unrelated histories - git merge --allow-unrelated-histories -m "Merging branches from 2 repos" origin/main

  4. Pushed MasterReplica to origin - git push -u origin MasterReplica

  5. Raised pull request on origin/MasterReplica to be merged into origin/main

  6. Clicked on Rebase and Merge which throws error -> "This branch cannot be rebased due to too many changes"

Looks like GitHub cannot merge a PR with too many commits hence the error. Is there any workaround to get this done? Thanks.

0 Answers
Related