6

There are two companies. Each one has a Git server running. If company A checks in some code this should be updated on company B server and the other way around.

The two servers should keep themselves sychronnized with each other.

Server OS: Ubuntu Server 14.04

GIT: Gitlab

Which solution would be appropriate in our case (mirroring, hooks,..)?

  • Have you thought this through? Say on both sides, modifications are made on the same part of a file. What happens when both are pushed and the servers try to synchronize each other? Who decides what's the conflict resolution? Worst case, the previous modification is completely lost in that process. These kinds of things should rather be solved by having one central server which is mirrored to the other, and code changes only being brought in over one of them. If that doesn't work you'd have to at least have one maintainer who sorts this out manually. – slhck Jul 07 '14 at 09:07
  • Yeah, we already discussed that problem. There will be a clear commitment, who will be responsible for that conflict resolution. There is only one guy on each side, who will develop and possibly push changes. – Matthias Reisner Jul 07 '14 at 09:15
  • Yeah, so there's another human layer above everything :) What Git server software and OS are you using, specifically? Maybe you can mention that in the question and add some tags. That'd make it easier to be discovered by others. – slhck Jul 07 '14 at 09:24
  • Updated my post with the additional information. But which technique should we use for the synch (mirroring, hooks,..) ? Are there good tutorials for that? – Matthias Reisner Jul 07 '14 at 09:31
  • I'm not an expert there. I've set up and maintained GitLab for a while, but I'd have to research myself. You could maybe set up a company-independent mirror that receives pushes from both servers, where both also continously pull from. – slhck Jul 07 '14 at 09:33

1 Answers1

2

I created a tool to synchronize on a level of Git-repositories and to delegate everything to project teams.
My tool is git-repo-sync.
It automatically synchronize two remote Git repositories. But it is possible to configure as many sync pairs as someone need.

I believe that servers could not be synchronized in a "Git order of things".
Even GitLab propose its mirroring on a repository level.

Technically, mirroring is possible at the server level too, but it will be an one-way synchronization.
People more often want to do changes from both companies and mirroring does not allow this.
There have always been limitations with mirroring except if it is used for backuping.

Imagine you have some server synchronization.
Next you'll ask your sides (companies) to check and repeat their Git-pushes and commits because they can disappear during a night time synchronization.
Then you'll ask your sides to do not commit to the same Git-branches to mitigate these troubles.
To mitigate but not eliminate.

I imagine ways how to implement some bidirectional synchronization on a level of Gitlab or Bitbucket.
I just decided not to implement this in my tool because it will be a little bit complicated.

In my case, I have many Git servers and not just Gitlab or Bitbucket.
There are many other reasons why I can't agree to synchronize servers or Git-solutions. But here no place to share my pain. :)

it3xl
  • 151
  • 7