如何设置“git cluster”

发布于 2024-10-20 17:14:31 字数 405 浏览 2 评论 0原文

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

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

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

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

当我们切换到 Git 时,我们正在寻找类似的设置。如何使多个 git 存储库合而为一?理想情况下,我希望提交到存储库以自动传播到同一存储库的其他服务器。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔戏命师 2024-10-27 17:14:31

一般来说,延迟对您来说不会成为问题,因为您将在本地提交。您可能根本不需要做任何事情。不过,推和拉可能会变慢。如果这让您烦恼,您可以做很多事情。

我们使用 github 作为我们的“权威”树,但我们不会推送到那里(我们的 代码审查系统 会这样做),而我们的构建者(和一些开发人员)不会从那里获取。

每次推送到 github 都会触发一个 post-receive hook 到我的 < 的一个或多个实例一个 href="https://github.com/dustin/gitmirror" rel="nofollow">gitmirror 项目,它可以立即获取镜像。这些镜像通常总是在 github 大约一秒内更新。如果中央仓库发生任何事情,其他人很可能都不会注意到。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文