I'm looking for a way to automatically synchronize Git repositories across (2) servers so they are interchangeable from a third point.
Situation is as follows: We heavily use git for all our projects, and some of the Repositories grow quite fast in size. Currently we have one central server and everyone is pushing/pulling to/from this one. However this all goes through the internet connection and therefore is not the fastest way.
The Idea: Put another server in the office, and have all the git repositories there for in-office-use. This server would need to be synchronized with the one on-line. At best the users would not even know which one they use via some dns-adjustment, so the address of the on-line server repositories resolves to the in-office-one when connected to the network there.
Is anyone already doing something similar out there? Or is there a easier way to accomplish the target.
First clone repository into you system via github.It will provide automatically after you login with github. Then start cloning. Then you can start work from your cloning location's project. Just push and pull your changes.
I would see such a mechnism easily done with the SSH protocol (meaning a framework like gitolite is in place both on the LAN repo and the WAN http repo), because then you can easily extend the ssh forced command mechanism to:
To do so with hooks is more complicated and would need to be carefully setup for each kind of server-side hooks in order to keep that synchronization mechanism up at all time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With