带有中央存储库的 Git
我刚刚在我的服务器上设置了一个存储库。我想与一小群开发人员一起使用它。我们希望有一个我们之间共享的中央存储库。我们没有 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
然后每个客户端都能够进行更改并将其推送到服务器并从其他用户那里提取更改。
我想问一下各位姐妹这个配置是否正确。看起来很简单,我怀疑它的正确性???
I've just set up a repository on my server. I'd like to use it with a small group of developers. We want to have a central repository shared among us. We don't have experience with Git, but we want to learn. I have followed this instructions.
On the server:
$ git init --bare --shared foo.git
Initialized empty shared Git repository in /git/foo.git/
$ chgrp -R dev foo.git
On the clients:
$ git clone ssh://<my_server>/git/foo.git
Then each client will be able to make changes and push them to the server and pull changes from other users.
I want to ask you girls and guys if this configuration is correct. It seems so simple that I was doubting about its correctness???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,差不多是这样。您可能还需要设置一个选项:
core.sharedRepository
,它告诉 Git,当它创建其他目录时,应该将它们 chgrp 到该组。关于如何设置它有一篇很好的文章 http:// criticallog.thornet.net/2010/01/07/sharing-your-git-repository/
Yep, that's about right. There's one more option you'd probably want to set:
core.sharedRepository
which tells Git that when it creates additional directories, it should chgrp them to that group.There's a good writeup on how to set it at http://criticallog.thornet.net/2010/01/07/sharing-your-git-repository/