Wednesday, January 18, 2017

permissions - Linux user group configuration for Git bare repository




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?


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"



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...