'Question Regarding Node JS App Deployment on Heroku

I have a nodejs application that I need deploy on Heroku that Connects with a mongodb Database Now I need to host this on heroku and have a dot env file which contains the creds (which contains DB_URL, DB_NAME , DB PASS)

So should I add .env into gitignore and the push the code into github repo or don't add it to gitignore and then push. Because I will be connecting this repo into heroku for deployment



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source