1

I would like to create a Git read/write cluster. That is clear how can I make it on server side. How replicate the commits from Server A to server B.

I try to search how can I set on client side to clone and read from server B and push/commit to server A.

GergA
  • 149
  • 10

1 Answers1

2

As far as I know, you can't directly do this when cloning, but you can change the remote that is created to use different URIs through the set-url command and the --push option:

git clone <ServerB> # Create a clone from ServerB
git remote set-url --push origin <ServerA> # Set the push URI of the default remote to ServerA

That way, it will always fetch from ServerB, but push to ServerA (of course only when using the defined remote)

Tim Schumacher
  • 576
  • 3
  • 12