Make a GIT repository read only for some users using gitosis

We are running a GIT repository using gitosis and we need to forbid the push to some people of the team.

So i want everybody have read access to all repositories (got +10 repo and +20 machines where the users can do commit pull and push)

I need to restrict only the push, i want user can continue doing pull and clone but not push, only 2 users can push to master.

So any ideas? maybe to ask a password before make push?

  • How to install Gitlab on Apache and a subdomain or different path
  • Ubuntu Server 14.04.1 LTS startup script java file
  • Move git configuration from Windows to Ubuntu
  • Upgrade git to 1.8.1.5 failed
  • gitlab 8.2.0 git not working
  • why my git use different key files?
  • Any tool to see differences between version in git
  • Can't push using EGit and Bitbucket
  • One Solution collect form web for “Make a GIT repository read only for some users using gitosis”

    You do this in the gitosis.conf file. Create two groups, one for those who can write to the repo, and one for those who have read-only access:

    [repo my_repo]
    description = Git repository for foobar
    owner = user1
    
    [group my-repo]
    writable = my_repo
    members = user1 user2
    
    [group readonly]
    readonly = my_repo
    members = user3 user4 user5
    
    Git Baby is a git and github fan, let's start git clone.