title: Git is changing my file's permissions when I push to server
body: <p>I am using git to manage a website on a server.</p>
  
  <p>I have a local repository shown below</p>
  
  <pre><code>local@workstation:myapp$ ls -l | awk '{k=0;for(i=0;i&lt;=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}'
  total 16
  755 drwxr-xr-x@ 18 thomas  staff   612 Jun 13 15:35 application
  755 drwxr-xr-x@ 11 thomas  staff   374 Jun 12 16:25 assets
  644 -rw-r--r--@  1 thomas  staff  6399 Jun 22 11:45 index.php
  755 drwxr-xr-x@ 10 thomas  staff   340 May 14 15:22 system
  </code></pre>
  
  <p>I have a bare repository on the server that uses <code>post-receive</code> to point the repo in front of apache. Apache's <code>public</code> folders contents are below -not the bare repository.</p>
  
  <pre><code>root@server:/srv/public/myapp# ls -l | awk '{k=0;for(i=0;i&lt;=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}'
  total 20
  700 drwx------ 15 root root 4096 Jun 27 11:31 application
  700 drwx------ 10 root root 4096 Jun 27 11:31 assets
  600 -rw-------  1 root root 6399 Jun 27 11:31 index.php
  700 drwx------  8 root root 4096 Jun 27 11:31 system
  </code></pre>
  
  <p>This is causing mayhem to my code on the webserver.</p>
  
  <p>How can I fix this? I'm using gitolite if that makes any difference.</p>
  
  <p>git server config file</p>
  
  <pre><code>[core]
          repositoryformatversion = 0
          filemode = true
          bare = true
  </code></pre>