threads / discuss / 21742

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

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

## tl;dr

2 messages between Nov 24, 2009 and Nov 25, 2009.

replies: 1people: 2as markdown or json

Liebich, Wolfgang· Nov 24, 2009, 21:19 UTC · lore

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· Nov 25, 2009, 10:14 UTC · re: Liebich, Wolfgang · lore

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

On Tue, Nov 24, 2009 at 22:19, Liebich, Wolfgang <wolfgang.liebich@siemens-enterprise.com> wrote:

Show 6 quoted lines
> 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/*).

← back to recent threads