Remove .env file from .gitignore to ease installation & setup
See original GitHub issueCurrently after cloning, users have to remove the .example
extension from the .env
file. This is annoying. Let’s just remove .env
from the .gitignore
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
How to hide .env file from Github - Stack Overflow
1st try: create .gitignore in your root project then include your file which want to ignore in GitHub repository. if 1st one do...
Read more >Removing a .env file from Git history - DEV Community
The best thing to do now is to remove the file right away and add it to your .gitignore file. In my case,...
Read more >Should I add .env to .gitignore? - Sal Ferrarello
The short answer is, “yes”. You should use your .gitignore file to ignore the .env file. Why Ignore .env. The .env file is...
Read more >Removing a .env file from Git history - Daily Dev Tips
The best thing to do now is to remove the file right away and add it to your .gitignore file. In my case,...
Read more >Part 4 - How to use .gitignore [Git-ing Started with Git Series]
Not all files need to be saved for time and all eternity. Git has a way to ignore files like your precious ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thought I’d leave a reference to facebook/create-react-app#2403 as it seems relevant to this discussion, where Dan Abramov supports committing
.env
file for convenience and the fact you can’t store real secrets in the client app.I’d like to take this!
I kind of agree with @jagzviruz.
.env
files are usually for things that might change on a per-environment basis, but we’re kind of using them as a dictionary. I don’t think our social links need to be there, so could we just keep them defined inconstants.js
?For the remaining variable (
NODE_PATH
), we could leave it defined there or prefix all our our scripts with it inpackage.json
(e.g."build:app": "react-scripts build"
becomes something like"build:app": "cross-env NODE_PATH=src/ react-scripts build"
). It’s a little verbose to have it defined so many times, so I’m open to more input on that.