git migration error: [remote rejected] master -> master (cannot combine normal pushes and magic pushes)
07:05 23 Dec 2020

I would like to migrate a repo from server-A to server-B, here is my procedure:

  1. git clone --mirror a repo, named test from server-A
$ git clone --mirror ssh://my.name@10.58.65.50:29418/test
Cloning into bare repository 'test.git'...
remote: Counting objects: 1836, done
remote: Finding sources: 100% (1829/1829)
remote: Total 2758 (delta 377), reused 2664 (delta 377)
Receiving objects: 100% (2758/2758), 1.28 MiB | 0 bytes/s, done.
Resolving deltas: 100% (949/949), done.
Checking connectivity... done.
  1. Create an empty repo (test) on server-B

  2. git push --mirror the repo (test) to server-B git push was failed, and the error log is listed as below:

$ git push --mirror ssh://my.name@10.58.65.51:29418/test  
Counting objects: 2661, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1713/1713), done.
Writing objects: 100% (2661/2661), 1.25 MiB | 0 bytes/s, done.
Total 2661 (delta 921), reused 2661 (delta 921)
remote: Resolving deltas: 100% (921/921)
remote: Processing changes: refs: 352, done    
To ssh://my.name@10.58.65.51:29418/test
! [remote rejected] master -> master (cannot combine normal pushes and magic pushes)
! [remote rejected] refs/meta/config -> refs/meta/config (cannot combine normal pushes and magic pushes)
! [remote rejected] refs/changes/00/12100/1 -> refs/changes/00/12100/1 (cannot combine normal pushes and magic pushes)
error: failed to push some refs to 'ssh://my.name@10.58.65.51:29418/test'

I have no idea of this error and how could I solve that?

Thanks!

git gerrit git-push git-mirror