bkeepers / dotenv

A Ruby gem to load environment variables from `.env`.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question on Removal of ### What other .env* files can I use? FAQ

jonmchan opened this issue · comments

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.

1350739

### 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®                                                |

@jonmchan thanks for bringing it up. I tried moviing it around and reformating it, but wasn't loving it and meant to come back to it. I just reintroduced it in b0c076f. Let me know what you think.