简体   繁体   中英

How can I give multiple users access to 1 git repo?

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

您是否在寻找一条绝对的道路?

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.

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