Ignore Git files that already exist in the repository
I made changes to some config files for dev purposes. And I didn’t want to commit that back into git. The problem is that .gitignore and .git/info/exclude don’t work on a file already in the repository. So after googling a bit, I found a way to do this here: http://justaddwater.dk/2009/12/07/how-to-make-git-ignore-files-that-already-exist-in-your-project/
And here’s the command from that link:
git update-index --assume-unchanged config/database.yml
Of course you won’t be able to update that file until you do:
git update-index --no-assume-unchanged config/database.yml
The doc on this command is here: http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html