I have a following requirement,two remote bare repositories repository A and repository B and my aim is to sync or push repoA
contents to repoB
@regular intervals.
I use Gitolite v3 btw, should I go for Gitolite mirroring or post-receive hooks? if its a post-receive, how to achieve it?
Certainly adding a post-receive hook (see "(v3.6+) variation: repo-specific hooks") is the easiest way.
Mirroring is mainly for synchronization between different gitolite servers (I suppose it could be setup to mirror on the same server as in
t/mirror-test
, but that it a bit overkill).Plus it adds:
That means:
If you have multiple gitolite servers to maintain, then mirroring is interesting, mainly because the
push --mirror
is done asynchronously from the initialgit push
to repoA.In that aspect, gitolite mirroring is quicker, because you push to A, and in the background, gitolite will
push --mirror
to other gitolite servers.But here, for just one other repo (on the same gitolite server, or on another gitolite server), a simple post-receive hook is enough.