Hi,
I would like to know what all files need to be git ignored while pushing the code? I am aware of config file,what else ?
There is already a fairly extensive .gitignore file in the root directory of the standard Moodle code. That should cover most things you shouldn't be committing.
Anything not covered by that would be custom code specific to your site, which we can't give general advice on - only you can make decisions about that.