使用多个服务器时如何/在哪里存储 git 存储库?

发布于 2024-11-18 19:43:30 字数 897 浏览 4 评论 0原文

我对 git 相当陌生,但我正在尝试在我们所有的系统中设置它,以便所有项目都由 git 和 gitosis 管理。

我的问题与考虑开发/登台/生产服务器时实际存储库的位置有关。

我应该...

A) 在一台服务器上设置 git 和 gitosis 来托管我的所有 git 存储库,并将适当的存储库拉到每个需要的地方(三台服务器和多台本地计算机)。

<Dev Server [git gitosis > myproject.git]> 
<Staging Server [git clone ...]> 
<Production Server [git clone ...]>

或者

B) 在所有服务器上设置 git 和 gitosis,以便 git 存储库与其各自的项目托管在同一服务器上,当项目从本地传递到开发、暂存到生产时,提交到每个服务器。通过这种方式,存储库仅与该服务器批准的内容一样最新。

<Dev Server [git gitosis > myproject.git]>
<Staging Server [git gitosis > myproject.git {updated from Dev Server}]>
<Production Server [git gitosis > myproject.git {updated from Staging Server}]>

当我写这篇文章时,似乎(A)将是更好的选择,并且每个服务器的正确发布将由不同的分支处理......不确定我是否关闭。

如果两者都不正确,请让我知道跨多个服务器设置 git 的适当方法。

快速概述如何管理这样的系统也很好......例如,分支的使用等......

I'm fairly new to git, but I'm trying to set it up across all of our systems so that all projects are managed by git and gitosis.

My question has to do with location of the actual repositories when considering the development / staging / production servers.

Should I...

A) Set up git and gitosis on 1 server to host all of my git repositories and pull down the appropriate repository to each place it's needed (three servers and multiple local computers).

<Dev Server [git gitosis > myproject.git]> 
<Staging Server [git clone ...]> 
<Production Server [git clone ...]>

OR

B) Set up git and gitosis on all servers so that git repositories are hosted on the same server as their respective project, commit to each server down the line as the project is passed from Local to Development to Staging to Production. In this way, the repositories are only as up to date as what has been approved for that server.

<Dev Server [git gitosis > myproject.git]>
<Staging Server [git gitosis > myproject.git {updated from Dev Server}]>
<Production Server [git gitosis > myproject.git {updated from Staging Server}]>

As I write this it seems like (A) would be the better option and that the proper releases to each server would be handled by different branches... Not sure if I'm off or not.

If both are incorrect please let me know of the appropriate way to set up git across multiple servers.

It would also be nice to have a quick overview of how managing a system like this would work... for example, use of branches, etc...

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

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

发布评论

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

评论(2

冷血 2024-11-25 19:43:30

我会选择第一个选项,并使用 Gitolite 而不是 Gitosis。 Gitosis 不再活跃发展。 Gitolite 为您提供更多功能。

希望这有帮助。

I would go with the first option and would use Gitolite instead of Gitosis. Gitosis is no longer actively developed. Gitolite gives you more features.

Hope this helps.

抱着落日 2024-11-25 19:43:30

我肯定会选择第一个选项;能够在任何地方快速轻松地访问代码的所有版本是一件好事。

I'd definitely go with the first option; having quick and easy access to all versions of your code everywhere is a good thing.

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