开发者

How/Where do you store git repositories when working with multiple servers?

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 开发者_如何学Pythonpassed 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...


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜