Question on Removal of ### What other .env* files can I use? FAQ
jonmchan opened this issue · comments
Jonathan Chan commented
hi there, love the project... Just wondering if the FAQ for What other .env* files can I use?
intentionally removed? I found the table very helpful. I was wondering if your positions on whether to prescribe .gitignore or not has changed or if it was just removed by oversight? Thanks for looking.
### What other .env* files can I use?
`dotenv-rails` will override in the following order (highest defined variable overrides lower):
| Hierarchy Priority | Filename | Environment | Should I `.gitignore`it? | Notes |
| ------------------ | ------------------------ | -------------------- | --------------------------------------------------- | ------------------------------------------------------------ |
| 1st (highest) | `.env.development.local` | Development | Yes! | Local overrides of environment-specific settings. |
| 1st | `.env.test.local` | Test | Yes! | Local overrides of environment-specific settings. |
| 1st | `.env.production.local` | Production | Yes! | Local overrides of environment-specific settings. |
| 2nd | `.env.local` | Wherever the file is | Definitely. | Local overrides. This file is loaded for all environments _except_ `test`. |
| 3rd | `.env.development` | Development | No. | Shared environment-specific settings |
| 3rd | `.env.test` | Test | No. | Shared environment-specific settings |
| 3rd | `.env.production` | Production | No. | Shared environment-specific settings |
| Last | `.env` | All Environments | Depends (See [below](#should-i-commit-my-env-file)) | The Original® |
Brandon Keepers commented