How to mirror git repo from another source to Gerrit repo?

77 views
Skip to first unread message

Mei B

unread,
Jun 20, 2018, 7:52:38 PM6/20/18
to Repo and Gerrit Discussion
I've tried...

git clone --mirror /origin/git.git
cd origin/git.git
git push --mirror /new/gerrit/repo

but i get

 ! [remote rejected] master -> master (non-fast forward)
error: failed to push some refs to 'ssh:/...xx.x'


This user has permissions like Forge Author, Commitor, ...
What else is needed to push?

David Pursehouse

unread,
Jun 20, 2018, 10:36:39 PM6/20/18
to Mei B, Repo and Gerrit Discussion
On Thu, Jun 21, 2018 at 8:52 AM Mei B <lidokaw...@gmail.com> wrote:
I've tried...

git clone --mirror /origin/git.git
cd origin/git.git
git push --mirror /new/gerrit/repo

but i get

 ! [remote rejected] master -> master (non-fast forward)
error: failed to push some refs to 'ssh:/...xx.x'

The new project already has commits with different history on the master branch.  If you've created this as a new repository, it's possible that the different history is only the "initial empty commit" that was created when the repository was created.

If this is the case, you can use the --force option on the push command.  To do this, your user needs the Push permission with the "force" option.

 


This user has permissions like Forge Author, Commitor, ...
What else is needed to push?

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Velly Zhou

unread,
Jun 21, 2018, 4:52:08 AM6/21/18
to Repo and Gerrit Discussion
Just write a script to clone the repo to review_site/git/ in with option --bare

在 2018年6月21日星期四 UTC+8上午7:52:38,Mei B写道:

Mei B

unread,
Jun 22, 2018, 2:48:39 PM6/22/18
to Repo and Gerrit Discussion
Thanks, it was that in combination of refs/meta/config  not being in the original repo. 

Michelle Pogado

unread,
Jul 15, 2018, 4:33:10 AM7/15/18
to Repo and Gerrit Discussion
Hi David, 


I am experiencing a different type of issue.

See below:
To ssh://some_gerrit_sit:29418/repository
 ! [remote rejected]     refs/changes/13/98013/1 -> refs/changes/13/98013/1 (change 98013 not found)
 ! [remote rejected]     refs/changes/13/98013/2 -> refs/changes/13/98013/2 (change 98013 not found)
 ! [remote rejected]     refs/changes/13/98013/3 -> refs/changes/13/98013/3 (change 98013 not found)
 ! [remote rejected]     refs/changes/15/98015/1 -> refs/changes/15/98015/1 (change 98015 not found)
 ! [remote rejected]     refs/changes/20/116720/1 -> refs/changes/20/116720/1 (change 116720 not found)
 ! [remote rejected]     refs/changes/24/125024/1 -> refs/changes/24/125024/1 (change 125024 not found)


I have tried the following:
- creating refs/changes/* and granting Create Reference access to Administrators.
- adding push = +refs/changes/*:refs/changes/* to my config
- confirming that the change can be viewed
$ git show-ref
96ae00f33058d31335e077ae154de91e9704a729 refs/changes/13/98013/1
$ git show 96ae00f33058d31335e077ae154de91e9704a729
commit 96ae00f33058d31335e077ae154de91e9704a729 (refs/changes/13/98013/1)
Author: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx


Is there any configuration necessary to make this successful?
Or are there any steps apart from git clone --mirror, git push --mirror?

Also, I can't use replication plugin since I am not an Admin of the source gerrit server.

Any suggestions on what else can be done?


Thanks!
Reply all
Reply to author
Forward
0 new messages