views:

53

answers:

2

We are having a local repository which is accessible to a large number of people. We have to set up a Git repository there such that only certain users have checkout as well as commit privileges. How can we do that.

P.S. : This is a part of our homework assignment in which we have to develop a game and update it using a Git repository. So, if anyone feels like we should not be asking this question here, please do tell.

+4  A: 

I'd recommend gitolite to manage user access to the repository.

Edit after comments:

gitolite is installed via git too.

I'm guessing that your teacher probably also meant to teach you – besides using git – to configure git protocols, ssh access (keys etc.).

You already got best advices: gitolite, gitosis, Pro git, adding to this man ssh, man ssh-keygen, man scp and git manual your homework should be easily solved.

takeshin
Or **gitosis** (see also relevant chapter in free "Pro Git" ebook).
Jakub Narębski
we cannot install any new software for the task unless absolutely necessary because we don't have the root access to the machine.
abhishekgupta92
@abhishekgupta92 Then use [github](http://github.com) instead.
takeshin
we need to set up a local repository.. :-(
abhishekgupta92
gitolite does not require any root access to a machine. ssh access is sufficient. Please read the documentation.
djs
@djs: Perhaps the point of the the homework is to learn how to use Unix permissions (owner, group-owner, other; read, write, execute). An SSH-based tool like gitolite or gitosis would work against this purpose (though it would be *another* good homework problem).
Chris Johnsen
thanks all. I solved the problem using SVN. The homework is about making a game which should be maintained on a local GIT Repository. (SVN was added later due to some issued).thanks takeshin.. for the invaluable information.
abhishekgupta92
+1  A: 

Since it is homework I will try to give hints.

  • What files and directories do other users need to read to access (or write to commit/push into) a repository?

  • What methods can you use to control the permission on these files and directories?

  • Does your application have any configuration options that might help?

Chris Johnsen