Thursday, April 14, 2011

Handle file permissions in shared git repository

When several people share their work on the same git repository, it is required to handle file permissions properly.
This is an ugly solution, but it seems to work

mkdir sharedrepo
cd sharedrepo
git init --bare
echo "chmod -f -R a+rw ." >> hooks/post-receive
chmod a+x hooks/post-receive
cd ..
chmod -R a+rw sharedrepo