Search code examples
gitlaravelheroku

git doesn't push .env file on the server


on my local server in my laravel app I have .env file.

to push changes to the server I use

git add . git commit -m "something" git push heroku master

but when I use heroku git:clone -a myapp in the cloned app there is no .env file... there is only .env.development file.

Do I do something wrong?


Solution

  • 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.