This is a really nice solution that I was looking for. I use this to make configuration file changes on my staging system without the need to ignore the whole config file.
Add your config file in .git/info/exclude
and then use git's update-index:
$ git update-index --assume-unchanged path/to/file
For a better explanation take a look at this blog article:
If you have configuration files or any other files in the local repository that you would like to keep as they are without the danger of adding them by mistake in a commit, you can specify that using the local git exclude file and update-index....