Staging - add ability to ignore certain files
Thanks for adding the new staging feature, this is great!
During my testing I discovered that my staging .htaccess file was pushed to live and the result was a 500 error on live. I need to use a slightly different .htaccess file on staging, because I force the www version on live. I couldn't access staging with this rule. So the differences in .htaccess rules caused the error.
It would great if you could add a way to ignore certain files, similar to gitignore.
Fabio Fava commented
So, some files should be left "as-is" for the already commented reasons:
- wp-config.php (salt keys & other tweaks we may do) and .htaccess (same reason).
- All folders having "cache" on the name should not be pushed/pulled (serialization).
The Staging as is on November 6 2018 isn't yet perfect. My main site is in Brazilian Portuguese, and when I select this language on the WordPress Settings, some custom translations get crazy as you can see on my ticket below:
Anyway I think we are very close of having a nerly-perfect Staging System.
Carl Nasal commented
Similiar to Steve's comment, I found that wp-config.php gets copied when you push or pull. I'm using Redis with the "WP_CACHE_KEY_SALT" defined in wp-config.php, and that key is being overwritten when pushing or pulling, which causes the site to use the wrong Redis cache key, which introduces all kinds of problems.
It would be nice if we could control what files to exclude, but even if not, there may be a few common files that should always be excluded like .htaccess and wp-config.php since those are designed to be specific for a given instance.