title: Using a git repository as a website root folder
body: <p>I want to serve a website directly from a git repository. Obviously, this will make updating the live server very simple - and I'm able to switch back to a previous branch if I have problems with new code.</p>
  
  <p>Are there any security issues?</p>
  
  <p>Do I need to add any directives to apache?</p>
  
  <p>Is there any non-secuity related issues else I should know about?</p>
  
  <p>EDIT : See Kan's answer below - and here is a directive to protect the .git folder as I want to set root folder at top level of the git repos</p>
  
  <pre><code>&lt;Files ~ "^\.git"&gt;
      Order allow,deny
      Deny from all
  &lt;/Files&gt;
  </code></pre>