The .env file has all the critical details which we generally do not pass in the source code like API keys, passwords, secrets, environment variables, tokens. It is extremely important that we make sure we do not push .env files to public repositories as there is a strong chance of credentials and API keys going into the wrong hands.
Always add your .env files to your .gitignore file in to ensure they are kept safe. This will not let git push .env files to the github repository. The .env files will be kept in the .gitignore file whcih can be accessed by other teammates

Top comments (0)