command used for gerrit replication ?

287 views
Skip to first unread message

gjarms

unread,
Jul 7, 2014, 8:24:21 AM7/7/14
to repo-d...@googlegroups.com
Dear Gerrit experts,

I am trying to understand how gerrit replication works internally. I run the following command for the gerrit replication

ssh -p 29418 <gerrit-server> replication start project-name. 

I would like to understand what is the actual command used for the replication? Is this a git push ? or something else?

Is it possible to simulate gerrit replication using git only?


Regards,
gjarms

Peter Niederlag

unread,
Jul 7, 2014, 8:51:14 AM7/7/14
to gjarms, repo-d...@googlegroups.com
Hi,

On 07.07.2014 14:24, gjarms wrote:
> Dear Gerrit experts,
[...]
> Is it possible to simulate gerrit replication using git only?

git "replication" basically boils down to "git fetch" plus "git push".

You get a nice example if you start a git clone with the --mirror
option: "git clone --mirror".

git replication is just a matter of having "remotes" (repositories on
different url's) and "refspecs" (which sha1's to fetch and push).

--- example of .git/config for replication -----
[remote "origin"]
fetch = +refs/*:refs/*
#fetch = +refs/heads/*:refs/heads/*
#fetch = +refs/tags/*:refs/tags/*
mirror = true
url = https://github.com/UPSTREAM/PROJECT.git
[remote "mirror"]
fetch = +refs/*:refs/*
mirror = true
url = g...@github.com:MIRROR/PROJECT.git
------------------------------------------------
git fetch upstream; git push mirror

In order for learning git "repliction" the manual on "git fetch --help"
and/or "git push --help" might be worth reading.

I think gerrit replication just applies permission checks on top of
regular git replication.

Greets,
Peter

Makson Lee

unread,
Jul 9, 2014, 9:57:36 AM7/9/14
to repo-d...@googlegroups.com, gja...@gmail.com, peter.n...@googlemail.com
And what are differences between replication over git and replication over ssh?

Regards,
Makson 

 

Steffen Gebert

unread,
Jul 9, 2014, 11:02:39 AM7/9/14
to repo-discuss
> And what are differences between replication over git and replication over ssh?
The one uses the git protocol, the other one SSH :-P

- git requires write access to a git-daemon, which is not so easy to secure, as there is no authentication. You have to make sure that only Gerrit can access this port, not the rest of the world / your corporate network
- ssh requires that the remote host accepts the ssh key that you configured for the (system) user as which gerrit is running (in ~/.ssh/config). While this is easy to set up, it has some scalability issues with bigger installations.

Yours
Steffen
> --
> --
> 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.

Reply all
Reply to author
Forward
0 new messages