Git Master Master Replication

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Git Master Master Replication

From: amitesh kumar <hidden>
Date: 2016-06-15 22:48:46

Hi im working on a project the will be deployed in many countries,
Is it possible with Git to host n masters?
Can any change on a particular master be propagated to others?

I have had a look at Gerrit2 but it only looks one way.

Cheers
Amitesh

Re: Git Master Master Replication

From: Dmitrijs Ledkovs <hidden>
Date: 2016-06-15 22:48:46

On 8 May 2010 11:41, amitesh kumar [off-list ref] wrote:
Hi im working on a project the will be deployed in many countries,
Is it possible with Git to host n masters?
Can any change on a particular master be propagated to others?

I have had a look at Gerrit2 but it only looks one way.

Cheers
Amitesh
In one git repository you can have only one branch with exactly the
same ref e.g. refs/heads/master.

By editing .git/config you can setup unlimited amount of locations of
where to pull from and where to push to (and you can pull from many
locations to a same branch and push one branch to many locations)

[remote "server-uk"]
      push = +refs/heads/master:refs/heads/master
      push = +refs/heads/uk/*:refs/heads/*
      pushurl = bla.co.uk

Similarly you can specify pulls using * or specifing each one.

.git/config is extremly flexible I'm sure you can make it work with
any amount of remotes =)

hope this helps.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help