published: 08 Oct 2022
5 min read
create a .gitignore file
add the lines
# environment variables .env .env.local .env.production
My preference is to use the following
.env .env.*
Then ensure its removed from the git repository
git rm env.local --cached git rm env.staging --cached git commit -m "Stopped tracking env.local, and env.staging"

Are we missing something? Help us improve this article. Reach out to us.
create a .gitignore file
add the lines
# environment variables .env .env.local .env.production
My preference is to use the following
.env .env.*
Then ensure its removed from the git repository
git rm env.local --cached git rm env.staging --cached git commit -m "Stopped tracking env.local, and env.staging"
Are you looking for other code tips?
TipsAndTricksta
I love coding, I love coding tips & tricks, code snippets and javascript