How can I give multiple users access to 1 git repo?
I'm setting up a git project and using my s开发者_C百科erver 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 user@host.com:projectname.git, it finds the project inside my home folder.
Naturally, user@host.com:projectname.git will access projectname.git in their home directory instead of mine.
How can I give multiple users access to the same repo?
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.
Are you looking for an absolute path?
user@host.com:/home/yourusername/projectname.git
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
Read chapters "Git on the Server" and "Distributed Git" of a free Pro Git book.
精彩评论