如何设置“git群集” [英] How to setup "git cluster"

查看:118
本文介绍了如何设置“git群集”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在考虑将我们的源代码版本控制系统从Subversion改为Git。我们正在推动当前设置的限制,并认为我们会更好地使用git。



我们一直在办公室使用主服务器,并在我们的数据中心运行一个镜像。该镜像被配置为代理到主服务器的传入提交。这样,这两台机器就像是一个单独的存储库一样运作,使我们能够在办公室时承诺办公室机器,或者当我们在别的地方时,承诺数据中心机器。



拥有两台机器可以为我们节省大量带宽并提高速度,这对我们来说很重要,因为我们也使用Subversion作为我们的主要部署工具。

在印度收购了一家开发商店,他们将使用相同的代码。由于带宽限制和延迟问题,在印度开一面镜子也会非常方便。

当我们切换到Git时,我们正在寻找类似的设置。我怎样才能让多个git仓库作为一个?理想情况下,我希望提交到一个存储库,以便自动传播到其他服务器以获取同一个存储库。 解决方案

延迟不会总的来说,这是一个问题,因为你会在本地提交。你根本不需要做任何事情。不过,推拉可能会变慢。如果您觉得麻烦,您可以做很多事情。



我们使用 github 作为我们的权威树,但我们不会推到那里(我们的代码审查系统)和我们的建设者(和一些开发人员)不会从那里拉。



每次推送到github都会触发一个 post-receive hook 到我的一个或多个实例 gitmirror 项目,它立即镜像提取。这些镜像通常在github的大约一秒内更新。如果中央仓库发生任何事情,很可能其他人甚至不会注意到它。


We are thinking of changing our source version control system from Subversion to Git. We're pushing the limits on our current setup and think we'll be better of working with git.

We've always used a primary server in the office, and a mirror running at our datacenter. The mirror is configured to proxy incoming commits to the primary server. This way the two machines operated as if it was a single repository, enabling us to commit to the office machine when we are in the office or to the datacenter machine when we are somewhere else.

Having two machines is saving us alot of bandwidth and increases speed, which for us is important because we use subversion as our primary deployment tool too.

Recently we acquired a development shop in India and they will be working on the same code. Because of bandwidth limits and latency issues, having a mirror in India would be very convenient too.

As we are switching to Git, we are looking for a similar setup. How can I make multiple git repositories act as one? Ideally I'd like commits to a repository to automatically propagate to the other servers for the same repository.

解决方案

Latency won't be an issue for you in general because you'll commit locally. You may not need to do anything at all. Pushes and pulls can get slower, though. If that bothers you, there are lots of things you can do.

We use github as our "authoritative" tree, but we don't push there (our code review system does) and our builders (and some developers) don't pull from there.

Every push to github fires a post-receive hook to one or more instances of my gitmirror project which does an immediate mirror fetch. These mirrors are generally always updated within about a second of github. If anything happens to the central repo, it's quite possible others won't even notice it.

这篇关于如何设置“git群集”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆