Instead of .gitignore, you can update local git repository by running following command:
git update-index --assume-unchanged <file>
In this case a file is being tracked in the origin repo. You can modify it in your local repo and git will never mark it as changed. Read more at:
- http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files/ – was reported dead at some time (sorry, not mine)
- http://archive.robwilkerson.org/2010/03/02/git-tip-ignore-changes-to-tracked-files/ – another one covering the same topic