How to make git ignore changes on commited files?

Sometimes there are some file that we want to ignore some file on git, of course we could use .gitignore, but that only take effect on untracked files. When the files already tracked/commited, we could make that file changes ignored using git update-index command, for example:

git update-index --assume-unchanged file-to-be-ignored

From now on, that file would not appear on git status or git diff when changed. When you want to track back the changes, use --no-assume-unchanged flag.

No comments :

Post a Comment

THINK: is it True? is it Helpful? is it Inspiring? is it Necessary? is it Kind?