0

I'm currently working on migration from Gerrit to GitHub. For that, I want to mirror the Gerrit repository to GitHub Enterprise.
I've run the following commands:

$ git cone --bare ssh://<gerrit_repo>
$ cd gerrit_repo.git
$ git push --mirror ssh://<github_repo>

The push is running into an error:

! [remote rejected] branch123 -> branch123 (failed)
// many more branches...
! [remote rejected] tag123 -> tag123 (failed)
// many more tags...

error: failed to push some refs to '<github_repo>'
valentin1807
  • 108
  • 6
  • 1
    You almost certainly want to start with `git clone --mirror` rather than `git clone --bare`, but there are likely to be Gerrit refs that GitHub won't like that you may need to snip before doing a `git push --mirror` as well. GitHub and Gerrit have very different workflow models so be sure you know everything you're getting into. (I have never done such a migration, never having used Gerrit in the first place, but it just seems likely to have a lot of friction points.) – torek Jun 11 '22 at 14:45

1 Answers1

0

The problem occurred due to bad commits in the git history.
We truncated the git history from these faulty commits and mirrored the repo.
Additionally we've backed up the entire Gerrit.

valentin1807
  • 108
  • 6