tags:

views:

122

answers:

4

I'm setting up a git project and using my server as the central repo for my group members.

My question is, how can I give multiple users access to that same repo?

As it currently stands, I successfully gave myself access, and added a repo. However, when accessing the repo with [email protected]:projectname.git, it finds the project inside my home folder.

Naturally, [email protected]:projectname.git will access projectname.git in their home directory instead of mine.

How can I give multiple users access to the same repo?

+1  A: 

Have you considered using gitosis ?

I am not sure what you are doing here but typically, you create a user account say git and create your central repo at /home/git/project/ and add everyone you wish to give permission's public keys added to ~git/.ssh/authorized_keys After that git clone git@server:project.git should get everything working.

anshul
Or gitolite: http://github.com/sitaramc/gitolite
Jakub Narębski
A: 

Are you looking for an absolute path?

[email protected]:/home/yourusername/projectname.git
phunehehe
Nope, never even thought of doing that. Thank you for the information, I'll try this tomorrow. I'm guessing I would just add each user to a group, then give that group read/write permissions to the folder?
Ryan Kearney
yeah I guess so :)
phunehehe
A: 

The key idea in git is that every user has his/her own repository. The concept of a "central" repository for everyone does not apply in the same sense as with Subversion or CVS. Instead, they are all just peers, and if you'd like to get changes someone made to their repository, you could pull the changes from them, similar, but not identical, to "updating" with SVN or CVS. You can, of course, have an "authoritative" repository that everyone can then clone from. Maybe you should read up on the idea behind distributed version control systems and decide, if you really want to use one.

An introduction for SVN users can be found here: IBM Developerworks

Daniel Schneller
Thanks for the input but we're using git for our 5 month class project. We all have an equal amount of authority in the project so no one user would handle a master repository. The idea was we would all connect to one central repository and commit as necessary. SVN is out of the question, it's just awful.
Ryan Kearney
@Ryan - SVN is demonstrably not awful, no issue with it not being an option in this case but equally you aren't currently able to get git to do what you want... if you want to use DVCS then you each have your own "working" repository - that's why its Distributed - and coordinate by pulling and pushing between repositories as changes are made. You will probably make your lives easier if you have a central repository that you all push changes to - not "owned" by any one member of your team but shared.
Murph
A: 

Read chapters "Git on the Server" and "Distributed Git" of a free Pro Git book.

Jakub Narębski