Description
This is sort of a continuation of #2560 and a new-visibility avenue for this spectrum question.
Basically, why do the docs say
.env
files should be checked into source control (with the exclusion of.env*.local
).
? I can definitely see saying ".env
files can be safely checked into source control" or something but I'm interested in the position of "they should be checked in". The only thing I can think of is "it's convenient for sharing environment variables between dev" (which is fine! But feels different than the given guidance).
Paste of important bits of Spectrum question
From other sources like 12factor and various devs I am getting strong opinions that .env files should not be committed and each developer/environment should just have whatever .env file or environment variables needed to do their development appropriately. In the linked GH question one user said:
.env files for front-end code should be checked in, because as you said, it contains no secrets. Additionally, these .env files affect build-time, not runtime behavior.
But I don't see how "they have no secrets" means they should be checked in, just that they can be checked in. And if the files are used for tweaking things at build time it's still not immediately obvious why those should be checked in. The discussion is largely semantic but I was interested on the community's opinion on ".env files should be checked into source control".