Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4669027yWhat these guys said, have a file that sits outside your project (usually env.ext) and reference it from your codebase do not add it to your repo.
Each environment should have its own version of the file (dev, sandbox’s, uat, production, ect) with usually different
Passwords and tokens suitable for that environment. -
And if you want to be nice add a file to the repo describing what should be in the file you don't add to the repo
-
okkimus17187yI would suggest you to store passwords in one file and import them where ever needed. Then create/edit ".gitignore" file and ignore the password file (git won't track that file -> it doesn't go to github). After that you can create a password template file.
Like if you had env.js file where is all the passwords you need, add it to .gitignore and create env-template.js where you remove your passwords. You might add comments to the file like:
// put your db password here
...
// put your db url/host here
...
Etc.
Note though, if git is already tracking the file before adding it to .gitignore you need to do some extra googling.
Related Rants
Im new on GitHub, and google didnt give me an answer simple enough for me to understand, so here i go.
How do i commit to GitHub and keep my files up to date, but without committing my password/oauth tokens?
Does one remove the line before committing, or what are you supposed to do?
Im using IntelliJ, dark theme
question
dark theme equals good programming
yes