4

我刚刚在我的服务器上设置了一个存储库。我想与一小群开发人员一起使用它。我们希望在我们之间共享一个中央存储库。我们没有使用 Git 的经验,但我们想学习。我已按照此说明进行操作。

在服务器上:

$ git init --bare --shared foo.git
Initialized empty shared Git repository in /git/foo.git/
$ chgrp -R dev foo.git

在客户端:

$ git clone ssh://<my_server>/git/foo.git

然后每个客户端将能够进行更改并将它们推送到服务器并从其他用户那里提取更改。

我想问你们女孩和男孩,这种配置是否正确。看起来很简单,以至于我怀疑它的正确性???

4

1 回答 1

4

是的,这差不多。您可能还想设置一个选项:core.sharedRepository它告诉 Git 当它创建其他目录时,它应该将它们 chgrp 到该组。

在http://criticallog.thornet.net/2010/01/07/sharing-your-git-repository/上有一篇很好的关于如何设置它的文章

于 2012-02-18T01:32:47.387 回答