-
Notifications
You must be signed in to change notification settings - Fork 8
Git permissions shared server environment
Michael Hulse edited this page Mar 13, 2018
·
3 revisions
This is totally dependent on your organization, but here’s one example:
- Create developer group (this is useful for non-Apache stuff).
- Add the apache user to developer group
- Add user to apache, wheel and developer groups
- Make group of repo developer (and owner can be any of the users in that group)
chgrp -R <group-name> <project_dir>/ # Change files and directories’ group
chmod -R g+w <project_dir>/ # Give write permission to the group
cd <project_dir>/ # Enter inside the project directory
git config core.fileMode false # Do not honor the executable bit of files in the working tree
git config core.sharedRepository group # Update the git's config
chmod g-w .git/objects/pack/* # Git pack files should be immutable
find -type d -exec chmod g+s {} + # New files get directory's group id
git init # Initializes the above changes