tags:

views:

21

answers:

2

Hi there, 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

+1  A: 

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: http://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.

Eric Dennis
+1  A: 

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:

  1. 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
    
  2. Cleanup the existing permissions:

    chgrp -R git .
    chmod -R g=u .
    
  3. 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
    
Chris Johnsen