我刚刚在我的服务器上设置了一个存储库。我想与一小群开发人员一起使用它。我们希望在我们之间共享一个中央存储库。我们没有使用 Git 的经验,但我们想学习。我已经关注了这个instructions .
在服务器上:
$ 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
然后每个客户端都能够进行更改并将它们推送到服务器并从其他用户那里 pull 更改。
我想问问你们这个配置是否正确。看起来简单到让我怀疑它的正确性???
最佳答案
是的,差不多是这样。您可能还想设置一个选项:core.sharedRepository
,它告诉 Git 当它创建额外的目录时,它应该将它们 chgrp 到那个组。
http://criticallog.thornet.net/2010/01/07/sharing-your-git-repository/ 上有一篇关于如何设置它的好文章
关于带有中央存储库的 Git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9337689/