Consider a git repository set up with a local filesystem remote, by user A as follows:
git init .
git remote add origin /var/git/my_project.git
touch X
git add X
git commit -m "My first commit"
git push origin master
If user B attempts to clone and then push, they will sometimes run into a permissions error because they cannot write to /var/git/my_project.git. User B could fix this by using sudo powers to change permissions on the remote:
sudo chmod 777 /var/git/my_project.git
Unfortunately, as soon as user B pushes, user A will have the same permissions problem.
How can I configure Git for both user A and user B such that when they push to the local filesystem remote, they will leave the permissions globally writeable?
(Note that I am aware of the security implications, but I am assuming only trusted users are able to login to the system in the first place.)