I am new at github and I am developing an app that has a config.php file that you must enter the database credentials.
config.php
In my github repository the file
.gitignore is for ignoring untracked files, but you need to ignore changes in the tracked one. you could use git update-index --skip-worktree /path/to/config.php
git update-index --skip-worktree /path/to/config.php
See https://git-scm.com/docs/git-update-index#_skip_worktree_bit