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.
Are there any security issues?
Do I need to add any directives to apache?
Is there any non-secuity related issues else I should know about?
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
<Files ~ "^\.git">
Order allow,deny
Deny from all
</Files>
There is only one concern – the
.gitfolder. But the git stores it in the repo root only. If you place your web-exposed folder as a subfolder of the repo, it will work great and doesn’t require any additional configuration. The file structure will be:So, there is no problem at all to expose the
www-filesfrom a web server.There is a great story of using the svn instead…