How to deploy your website without other users getting into your database user and password file?

Lets say I want to deploy a folder into github and it's connected to a database and I name it a file called db.php. Is there a way to make it so that when I upload this to GitHub, I can still connect to the database but other people cannot find the file?

Dose the gitignore file dose that? I never thought about it until now.
Was this page helpful?