I have two git repositories in one single git instance and need one set of users to access one repository and another set of users to access second repository.

How can I create a group, and add users to it and provide them permissions to access the git repository.

  • 1
    I am trying to achieve this in windows machine using git bash – Karthik V Jan 28 '15 at 21:19
  • This sounds more like "2 projects within a single git instance" NOT really "2 git repositories inside single git instance" – Michael Durrant Feb 1 '15 at 13:25

Based on the updated info - two projects in one repository, in different directory trees:

Have two repositories. There should be little to no additional cost, certainly for a short term (<30 day) approach. Let git do what it is good for and works simply - repo's with users and don't try and smoosh them together. You'll waste time and effort you'd be better off spending on other stuff.


As an alternative to my other answer (two repositories), if groups is really what you want, you could use gitosis.

More at http://shapeshed.com/setting_up_git_for_multiple_developers/

It basically lets you have one shared key for the group of users to access the repo.

  • Let me explain my problem in detail. I have a single git instance on a server. I am adding two different projects into that git instance. I need only specific set of users to use one project and another specific set of users for another project. – Karthik V Jan 29 '15 at 14:42
  • I am new to GIT. So i need the SSH key option in detail how it could resolve the issue. If you could provide exact steps would be helpful. – Karthik V Jan 29 '15 at 14:44
  • I hope SSH option is applicable only to a single repository. Are there any other options available to provide access to two different projects inside a single git instance. I want some options without using any tools or framework. – Karthik V Jan 29 '15 at 19:45
  • ok, so projects in one repository, separated by different directories. For this just two two repositories. let me do another answer for this. – Michael Durrant Feb 1 '15 at 13:21
  • i have two different repositories inside a single git instance in different directories. I need to understand the exact steps for permissions both the repositories. Say for example, rep1-proj1 should have x users accessing it and rep2-proj2 should have y users accessing it. x users should not have access to rep2 and vice-versa. if you could please provide us with the exact steps to acheive this. – Karthik V Jul 21 '15 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.