title: Should i not put a git repository in "htdocs"?
body: <p>I'm getting more and more into Git and have to straighten this one out,</p>
  
  <p>I read somewhere that it's bad security practice to put a .git repo inside folders that can be accessed trough the web (sounds reasonable!).</p>
  
  <p>My question is, besides if its correct, what's the best solution to this is? The problem occuring mainly of course if you work on a remote host while web-developing.</p>
  
  <p>For example if i work on domain.com/project where "project" is the repository, what can i do?</p>
  
  <p>Is it possible to move the .git-folder somewhere outside htdocs and link to it? Or can i add some layer of protection to it?</p>
  
  <p>I'm primarily developing on a shared host so i'm limited in what i can install and set up.</p>
  
  <p>I'v read than you can have the whole repository/folder somewhere hidden on the server and then set a script to copy the content when pushing to it.</p>
  
  <p>But when developing on a "live" server, i want to be able to test my code in real time between commits.</p>
  
  <p>Am i clear? </p>
  
  <p>Help appreciated!</p>