4 ms·
.git should never be in your web root... I can't think of any situation (other than a very simple site) where you'd want to just stick the whole Git repository
by dan15 13y ago
.git should never be in your web root... I can't think of any situation (other than a very simple site) where you'd want to just stick the whole Git repository in the web root. Normally there's a bunch of other things in the repository (documentation, database scripts, etc.) that you wouldn't want exposed publicly.
- dsirijus 13y agoYou can hide it very easily with any of the virtual host syntax, and it's easy to deploy that way. I say, why not.
- kcbanner 13y agoBecause of all the reasons parent mentioned.
- StavrosK 13y agoYou should do both, though.
- brown9-2 13y agoYou could also very easily add one additional command to your deploy script to copy all the web content from the directory being pulled to to the web root, and not have to worry about any accidents.
- astrodust 13y agoOr you could set the web root to be that directory.
- dan15 13y agoHiding it is riskier than just not having it there in the first place. Why blacklist when you can whitelist?