带有中央存储库的 Git

发布于 2025-01-06 23:01:55 字数 498 浏览 1 评论 0原文

我刚刚在我的服务器上设置了一个存储库。我想与一小群开发人员一起使用它。我们希望有一个我们之间共享的中央存储库。我们没有 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 技术交流群。

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

发布评论

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

评论(1

天赋异禀 2025-01-13 23:01:56

是的,差不多是这样。您可能还需要设置一个选项: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/

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