Locking files in git repository

The way to ignore certain files that are already committed is:

    git update-index --skip-worktree filename

I thought that this shortcut might be useful to exclude/protect files from version control.

Usage:

    git proctect-file config/database.yml