You want to customize .gitignore files in your repo.
Basically, your configuration files should not be added to your repo. You can use the .gitignore file for this.
Tell me if there is a includes/ directory. There, create a .gitignore file with the following:
config.php
This suggests that config.php from this directory should not be added to the repo. Note: this will not work if the file is already added. If it has already been added, you must git rm the file.
Now, since the config.php will not exist in your repo at all, I would recommend creating config.sample.php , which looks exactly like you config.php , and is part of your repo. Thus, when you clone (or someone else clones) your project, they know exactly what should be in the configuration file.
source share