I have a central repository with a subset of files that I want to protect from being changed (by pushing) from other users. If I add these files to .gitignore,
It sounds to me like the problem lies elsewhere if you need this level of access restriction.
Nonetheless, if you indeed do want to implement this, consider Gitolite. It allows you to define rather detailed access rules and should probably suffice for your needs.
Gitolite documentation: http://gitolite.com/gitolite/master-toc.html
You can define 'virtual refs' to control access on file level. More on that: http://gitolite.com/gitolite/vref.html