git doesn't push .env file on the server git doesn't push .env file on the server heroku heroku

git doesn't push .env file on the server


Check your .gitignore file if you have one there. If your git repo was set up for you automatically or imported from another project then it is likely that it is being ignored by default.

If it is in there then simply remove it to include your .env file in your next commit.


Laravel, by default, ignores the .env - this is very much intended, as your different environments should technically have, well, different env files. It also helps you from not submitting credentials (such as for your database) into version control.

I would recommend you continue to follow this intended practice and look into using heroku config variables:https://devcenter.heroku.com/articles/config-vars


Open file text .gitignore on root folder, git will skip file and folder in .gitignore. You just delete all text. Then review git status.