Answer the question
In order to leave comments, you need to log in
How to make 2 files (local and heroku) with same name but different content via gitignore?
Hello. I apologize for the noob question, but it hasn't worked for 3 days already)
So, the project has a file with database access settings. for heroku and local development, they should naturally be different. I added the file to gitignor, but when I needed to edit and push it to heroku, git outputs something like "this file is in gitignor add the -f switch if you really want to push it" well, I add the key, after that the file seems to disappear from gitignor and when I change settings back to local after git add . (I sometimes want to push the entire project) everything crashes, because this file again contains local settings (on Heroku). did git rm --cached <filename>, didn't help..
I understand that I’m messing up something in the order of actions, but I don’t understand where ... Could someone explain step by step how to do it right?
Answer the question
In order to leave comments, you need to log in
you can use heroku's environment variables set through the settings, and locally .env
Just program so that the absence of a .env file does not interfere with the launch
Create a file with variables, I have this .env
Add it to gitignore
Push the repository to Heroku Via
ssh go to Heroku (Is it possible)
Create a file there with the same name
Everything is perfectly ignored and works
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question