title: git push error, unable to write sha1 filename ./objects
body: <p>Here is a problem.</p>
  <p>I create a new repository with</p>
  <pre><code>mkdir -p repositories/project.git
  cd repositories/project.git
  git init --bare --shared=all
  </code></pre>
  <p>The repository is at shared local folder. UMASK is 022.</p>
  <p>Later on, folks in my team are able to clone the project and push a few changes.
  However, soon they come across this issue when they try to do 'git push'.</p>
  <pre><code>error: unable to write sha1 filename ./objects/3c/c2f933427a4215d3237a0c3b874a4ff16725: Permission denied
  To myaccountname@nameofthecomputer:/repositories/project.git
   ! [remote rejected] master -&gt; master (unable to migrate objects to permanent storage)
  error: failed to push some refs to 'myaccountname@nameofthecomputer:/repositories/project.git'
  </code></pre>
  <p>The problem is obviously in the way git creates some internal files/objects, because if I do:</p>
  <pre><code>sudo chmod -R 777 project.git
  </code></pre>
  <p>the problem is temporarily gone.</p>
  <p>What am I doing wrong?</p>