Skip to content

Commit 8514740

Browse files
committed
Add .env to optionally ignored files
Many twelve-factor apps use environment variables rather than the built in Rails secrets mechanism to store secrets. The [dotenv](https://github.com/bkeepers/dotenv) gem is widely used for this purpose and allows environment variables to be loaded from the `.env` file. However, this file should not be committed to source control. This PR just adds the `.env` file to `.gitignore` so that these secrets aren't accidentally committed. In some rare instances, it may be required that this file is committed to source control so I've added it to the list of files that can be removed if the developer is ok with secrets being committed.
1 parent f454371 commit 8514740

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Rails.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pickle-email-*.html
1515
# TODO Comment out these rules if you are OK with secrets being uploaded to the repo
1616
config/initializers/secret_token.rb
1717
config/secrets.yml
18+
.env
1819

1920
## Environment normalization:
2021
/.bundle

0 commit comments

Comments
 (0)