Linux user group configuration for Git bare repository

gitgroupslinuxpermissions

I'm using a Ubuntu box to host my bare Git repositories for developers to work off.

At the moment I'm creating a user account for each developer on the box because it doubles as a filestore and local testing server.

When somebody pushes to the bare repository other developers are unable to work on the files which change in the objects folder as a result. The new files are created with the user of the developer who pushes.

I have placed all the developers into a dev group but the umask doesn't allow the group to edit.

I've never had to set up a Git repository so haven't had experience in working with the permissions. I do want each developer to have their own user account on the test server, and I would prefer them to do actions on the server using that account. I don't mind giving them sudo rights.

Is setting the umask for each developer the way forward?

Best Answer

While "How do I share a Git repository with multiple users on a machine?" does address your issue (and involves setting umask for the users), I prefer adding to my git installation an authorization layer like gitolite (see its documentation).

  • No sudo right to give to anymone.
  • All git repo operations are done by one 'git' user.
  • you can set precisely the umask for newly created (and gitolite-managed) Git repos: "Setting umask in Git / Gitolite"