From 85147407e49bb039a44685a339a1d60bb6546c3f Mon Sep 17 00:00:00 2001 From: Max Woolf Date: Thu, 12 May 2016 08:53:20 +0100 Subject: [PATCH] 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. --- Rails.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/Rails.gitignore b/Rails.gitignore index 2121e0a8..b2c3f311 100644 --- a/Rails.gitignore +++ b/Rails.gitignore @@ -15,6 +15,7 @@ pickle-email-*.html # TODO Comment out these rules if you are OK with secrets being uploaded to the repo config/initializers/secret_token.rb config/secrets.yml +.env ## Environment normalization: /.bundle