How can I make my local Git repository accessible for multiple users?

11,390

Solution 1

Apparently, --shared={all|world|everybody} is broken in recent Git. Use octal permissions:

git init --shared=0777

Solution 2

you need to specify in the shared option which group of users you want to share with. http://www.kernel.org/pub/software/scm/git/docs/git-init.html

you also need to make sure all the users you want to share with are in the same group.

Share:
11,390
12345
Author by

12345

Updated on June 04, 2022

Comments

  • 12345
    12345 almost 2 years

    I want to create a git repository and allow all users to have access to it. I tried initializing it by:

    git init --shared=all 
    

    However when I change the user and do a git status, I get the following error:

    fatal: Unable to create '.git/index.lock': Permission denied
    

    Is this supposed to happen? I access the repo on my local file-system and not via SSH.

  • 12345
    12345 over 13 years
    Can't I make it accessible to all? Do I NEED to make it accessible to a group?
  • 12345
    12345 over 13 years
    Lars, when I try to do a commit as another user, this is the error message I get: fatal: could not open '.git/COMMIT_EDITMSG': Permission denied So I doubt that did the trick. I've changed my files to CHMOD 777, so the permissions to the file is not a problem ...
  • Akki
    Akki over 11 years
    I have same problem, even after git init --shared=0777. Any solutions?
  • P.R.
    P.R. about 10 years
    you might have to create a bare repository: git --bare init --shared=0777