I want to create a git repository and allow all users to have access t开发者_如何学JAVAo 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.
Apparently, --shared={all|world|everybody}
is broken in recent Git. Use octal permissions:
git init --shared=0777
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.
Alternatively, you can try to avoid setting the permission level to 777,
change the ownership
sudo chown -v -R username:groupname sprout
chmod -R g+w .git/*
精彩评论