简体   繁体   中英

Git with a central repository

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???

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM