git update-index --assume-unchanged config/database.yml

http://stackoverflow.com/questions/3833757/how-do-i-gitignore-and-delete-an-already-commited-file-without-affecting-other