Unire @David Underhill e @kixorz risposte, ho fatto la mia soluzione (definitiva).
E 'per nude pronti contro termine e non nude pronti contro termine. Ci sono solo piccole differenze tra loro, ma in questo modo è più chiaro.
REPOSITORY NUDO
cd <repo.git>/ # Enter inside the git repo
git config core.sharedRepository group # Update the git's config
chgrp -R <group-name> . # Change files and directories' group
chmod -R g+w . # Change permissions
chmod g-w objects/pack/* # Git pack files should be immutable
find -type d -exec chmod g+s {} + # New files get directory's group id
dove:
<repo.git>
è la directory di repository nuda, in genere sul server (ad esempio my_project.git/
).
<group-name>
è il nome del gruppo per utenti git (ad esempio utenti).
repository non-BARE
cd <project_dir>/ # Enter inside the project directory
git config core.sharedRepository group # Update the git's config
chgrp -R <group-name> . # Change files and directories' group
chmod -R g+w . # Change permissions
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
dove:
<project_dir>
è la directory del progetto che contiene la cartella .git
.
<group-name>
è il nome del gruppo per utenti git (ad esempio utenti).
C'è ** [una risposta eccellente a questa domanda] (http://serverfault.com/questions/26954/how -do-i-share-a-git-repository-with-multiple-users-on-a-machine) ** su ServerFault (un altro sito StackOverflow). – Zearin