What to .gitignore in SS 4.2+

We were having a bit of a discussion in the office in terms of what to exclude from the GIT repo in SS4.


But what else? Should anything else be excluded from the public folder, for example? What about the .htaccess files (i.e. if you need to add additional rules on the server - e.g. block traffic from certain IP addresses or whatever).

That’s pretty much all we have in our .gitignore, though we also ignore public/resources/ as they’re re-exposed by composer as part of our deploy process.

I wouldn’t include .htaccess in .gitignore, but that’s more personal preference than “OMG DON’T DO THAT”. If you need additional rules specific to one server, it’s usually better to add them at a webserver-config level (typically in your vhost configuration files).

Also, on a per-project basis, keep an eye on the .yml files in your config directory. Some modules keep things in there which you wouldn’t want in a repo (API keys, usernames, etc.)

@Tim, if you dont keep API keys in your repository then where do you keep them?

I tend to treat them like passwords… so they generally stay with the environment. Quite often, the dev and production environments would use different credentials anyway.

I don’t think there’s hard-and-fast rule, I only mentioned it as something to bear in mind.