title: Pushing to a Git repository on an NFS share fails
body: <p>We currently have our Git repositories on the local disk. They are shared by groups and accessed over SSH (with git-shell).</p>
  
  <p>Because of space issues, we now want to move the repositories to an NFS share on a NAS. I've been experimenting with this, and have run into a weird issue. A fresh (and bare) repository with exactly the same permissions can be cloned fine, but pushing changes (touch foo &amp;&amp; git add foo &amp;&amp; git commit &amp;&amp; git push origin master) fails with the error "Couldn't set refs/heads/master" and "failed to write".</p>
  
  <p>Now, if I repeat this scenario on the local disk, refs/heads/master becomes owned by whatever user pushed. Conversely, on the NFS share, if I change its owner to the user who is trying to push, no error is thrown. However, in both cases, the user is a member of a the group that owns the entire repository and has group write permission. Additionally, if I just log in using SSH as a user who is a member of this group, I can touch refs/heads/master (as is to be expected), both on the NFS share and the local disk.</p>
  
  <p>Consequently, I am at a loss here. I have no idea why a different file owner would cause the push to fail, seeing as how the group permissions allow the user to overwrite refs/heads/master. Moreover, even with a chmod 777 on that file, the push fails unless I chown the file.</p>
  
  <p>If anyone can shed some light on this weirdness, I'll be most grateful. Thanks in advance!</p>