We have made the HTTP protocol works for our git repository.
We need to made the files writable by Apache otherwise you could never push the commits back to the server.
To setup a new repository, we could flag it as a shared repository during initialization. Then we could change the repository root folder.
git init --bare --shared=group <new-repo>.git chgrp -R <group> <new-repo>.git
If that is an existing repository, we have to do a few steps more
1. Set the group.
chgrp -R <group> <existing-repo>.git
2. Flag the repository as a shared repository by editing the <existing-repo>.git/config.
[core] repositoryformatversion = 0 filemode = true bare = true sharedrepository = 1
3. Make sure the <existing-repo>.git/objects is writable by the group.
chmod -R 775 objects
Done =)
Reference: StackOverflow – How to configure an existing git repo to be shared by a UNIX group