# What is the best way to synchronize two *bare* repositories with each other?

2 messages from 2009-11-24 to 2009-11-25. Participants: Liebich, Wolfgang, Alex Riesen.
Thread: https://gitlist.dev/t/21742

## Liebich, Wolfgang, 2009-11-24 21:19

Subject: What is the best way to synchronize two *bare* repositories with each other?
Message-ID: <7FF082147E322048955113B6CB87A7C0081731C659@MCHP058A.global-ad.net>
URL: https://gitlist.dev/e/7FF082147E322048955113B6CB87A7C0081731C659%40MCHP058A.global-ad.net

```
Hi,
Let's say I have two bare git repositories, bareA and bareB.
I also have a third non-bare repo, lets call it workA. Coworkers also have their working repositories, they all
synchronize back to repoA.
My work repo can only synchronize directly with repoB.
What is the best way to keep repoA and repoB synchronized to each other?

I solved that by defining (in the "config" file of repoB) a remote section for repoA,
and I "fetch" from repoA by issuing "git remote update repoA", and I push back via
"git push --all repoA".

This strange setup is necessary because of the security setup (my home development machine is not directly
connected with the company intranet).

Is this a good way to solve that problem, or are there better methods?

Ciao,
- Wolfgang
```

## Alex Riesen, 2009-11-25 10:14

Subject: Re: What is the best way to synchronize two *bare* repositories with each other?
Message-ID: <81b0412b0911250214nb97f997h686a10622fbf3e01@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0911250214nb97f997h686a10622fbf3e01%40mail.gmail.com
In-Reply-To: <7FF082147E322048955113B6CB87A7C0081731C659@MCHP058A.global-ad.net>

```
On Tue, Nov 24, 2009 at 22:19, Liebich, Wolfgang
<wolfgang.liebich@siemens-enterprise.com> wrote:
> Hi,
> Let's say I have two bare git repositories, bareA and bareB.
> I also have a third non-bare repo, lets call it workA. Coworkers also have their working repositories, they all
> synchronize back to repoA.
> My work repo can only synchronize directly with repoB.
> What is the best way to keep repoA and repoB synchronized to each other?

Take a look at "--mirror" option of "git clone" (it sets up a remote
with references
mapping like this: refs/*:refs/*).

```
