question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove .env file from .gitignore to ease installation & setup

See original GitHub issue

Currently 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:closed
  • Created 5 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
darrenvongcommented, Jan 9, 2019

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.

1reaction
trent-boydcommented, Jan 4, 2019

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 in constants.js?

social: {
  // we could just remove everything before and including the ||
  FB_URL: process.env.REACT_APP_FACEBOOK_URL || 'https://www.facebook.com/codingcoachio/',
  INSTA_URL: process.env.REACT_APP_INSTA_URL || 'https://www.instagram.com/codingcoach_io/',
  TWITTER_URL: process.env.REACT_APP_TWITTER_URL || 'https://twitter.com/codingcoach_io',
  GITHUB_URL: process.env.REACT_APP_GITHUB_URL || 'https://github.com/Coding-Coach/coding-coach',
},

For the remaining variable (NODE_PATH), we could leave it defined there or prefix all our our scripts with it in package.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found