I have cloned a repository and the master branch in my repo is tracking origin/master. I created a work branch and changed some config
What you need is a .gitignore file and add all your config file inside the .gitignore file.
Once your .gitignore file is ready you might need to removed your config files from the Cache
Here's the command:
(Assume you use linux)
vi .gitignore
//Add all your config file inside
//run the following command to remove your config file from GIT cache if your config files is already track by GIT
git rm --cached myconfig.php