I've got a git remote repo at my server. Everytime I push my local branch to the server the files in ~/objects have just the rw permissions for my specific account(not my group – git). So when my friend does a push concerning those files in ~/objects hes getting a rights-permission error.
Hes in the same group: git, but of course does not have the rights to write (because the group git has'nt)
How do I tell git to give those files the right rights to the whole git-group ?
Thanks for your help.
_christoph
The “Please make sure you have the correct access rights” error occurs if you do not have the right permissions to access a Git repository. To solve this error, make sure you are referring to the correct remote URL and that you have set up SSH authentication correctly.
Changing permissions for a team or personUnder your repository name, click Settings. In the "Access" section of the sidebar, click Collaborators & teams. Under "Manage access", find the team or person whose role you'd like to change, then select the Role drop-down and click a new role.
Select the GitHub App whose permissions you want to change. In the left sidebar, click Permissions & webhooks. Modify the permissions you'd like to change. For each type of permission, select either "Read-only", "Read & write", or "No access" from the dropdown.
From git-config(1):
- core.sharedRepository
When group (or true), the repository is made shareable between several users in a group (making sure all the files and objects are group-writable). […]
Do this on the server:
Configure the repository for group sharing.
This will effectively forcibly widen the umask for future Git operations.
cd /path/to/repository.git
git config core.sharedRepository group
Cleanup the existing permissions:
chgrp -R git .
chmod -R g=u .
Force group owner inheritance for new entries (not needed on BSD-style systems, but usually needed on other systems):
find . -type d -print0 | xargs -0 chmod g+s
I recommend that you have your developers use a common user account when connecting to the remote repo server that you operate. You can manage access via SSH keys so you don't have to worry about distributing/sharing passwords, etc.
If you want to stick with using separate user accounts, then this question was answered well over at serverfault: https://serverfault.com/questions/26954/how-do-i-share-a-git-repository-with-multiple-users-on-a-machine
You might want to look into using gitosis for running your own repo: http://eagain.net/gitweb/?p=gitosis.git
Good gitosis setup instructions are available at http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With