1

I wonder where should I place my .gitignore file when the EE system folder is above the root and I need to track those files.

This is my .gitignore at the moment:

# Globals and OS junk files
[Tt]humbs.db
.DS_Store
*.DS_Store
cgi-bin/
error_log

# Subversion files
.svn

# Master Config
config/config.local.php

# Images and Media
sized/
thumbs/
_thumbs/
made/
remote/
public_html/media/**/*
!public_html/media/**/*.gitkeep

# Caches
system/expressionengine/cache/**/*
system/expressionengine/cache/eedt/**/*
!system/expressionengine/cache/**/index.html
!system/expressionengine/cache/**/*.gitkeep
!system/expressionengine/cache/**/current_version

Any ideas?

3

Above the webroot in this case.

| improve this answer | |
  • In that case, do I need to add rules like ignoring "public_ftp" folder, for instance? – Sergio Acosta Nov 6 '13 at 13:37
  • that depends I guess. I wouldn't have thought you'd have that directory locally - unless you've dumped your production environment into your local machine. If you've done that then yes. Your setup is pretty identical to ours. – Steven Grant Nov 6 '13 at 14:07
2

I guess you know this, but you shouldn't set up your production sites like that. Ideally it should be:

.git
.gitignore
system/
third_party/
templates/
webroot/

etc.

You don't want any expressionengine files, addon files, or .git files to be accessible via webroot, or even set up some system to make them unavailable - the easiest and safest is just to keep them outside the webroot.

| improve this answer | |
  • Even with this approach, the question is still valid for gitignore files because you may have more than one. Gitignore files further down the hierarchy override those that are higher up. Granted, he mentioned one gitignore file for ExpressionEngine, but there still may be other gitignore files for other items in the webroot. – John Fuller Nov 7 '13 at 14:33
1

Personally, I wouldn't want my deployment method to dictate my placement of Git related files. I would rather my deployment process "clean" my environment and perhaps as a back-up, configure the web server to not serve Git related files. For example, here are some suggestions for Apache configurations in another question.

https://serverfault.com/questions/128069/how-do-i-prevent-apache-from-serving-the-git-directory

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.