git 服务器复制
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6934350/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git server replication
提问by l.thee.a
We are using git for a multi site project and both the repo and the team have grown substantially. Therefore remote sites are suffering. I would like to add new git servers to the remote sites to decrease the load on our git server and to make the downloads faster. However I am not sure how to keep these synchronized. Is there any way to replicate git servers atomically? And if not any other suggestions?
我们正在将 git 用于多站点项目,并且 repo 和团队都得到了大幅增长。因此,远程站点正在遭受痛苦。我想向远程站点添加新的 git 服务器,以减少我们的 git 服务器上的负载并使下载速度更快。但是我不确定如何保持这些同步。有没有办法以原子方式复制 git 服务器?如果没有任何其他建议?
采纳答案by Andy
You could have a main "write" repo, and multiple remote, read only, repos pull from that. In turn, remote users would pull from those. That would give you increased download speeds from remote sites. Uploads would still be the same, but it seems like download speed is your main concern.
您可以拥有一个主要的“写入”存储库,以及多个远程只读存储库从中拉取。反过来,远程用户将从这些中拉出来。这将使您提高从远程站点的下载速度。上传仍然是相同的,但下载速度似乎是您主要关心的问题。
回答by Dustin
You can't replicate atomically. I'm kind of hoping that that's not what you mean.
你不能以原子方式复制。我有点希望那不是你的意思。
I wrote gitmirrorfor automatically triggering a remote pull-based replication on repository change. It requires a tiny bit of setup, but I've got tons of stuff coming through github into it (and a few that don't use github).
我编写了gitmirror用于在存储库更改时自动触发基于拉取的远程复制。它需要一点点设置,但我已经通过 github 获得了大量的东西(还有一些不使用 github)。