Ignore modified file from commit

Sometimes you need to change some files, just for your development environment and you don’t want to commit those changes. With Git there a way to fix your problem.

First of all, made all the change you need in the file(s) to ignore then run this command:
[cc_shell]
$ git update-index –assume-unchanged path/to/the/file/to/ignore
[/cc]

and it’s done, now your changes are ignored.

Sure, you can roolback those changes by running the command
[cc_shell]
$ git update-index –no-assume-unchanged path/to/the/file/to/version/again
[/cc]

At any point, if you feel that you lost the count of the untracked files, you can list all the files versioned with the files the that starts with a lowercase letter are ignored from versioning.
[cc_shell]
git ls-files -v
[/cc]

To simplify the output run this command, it will only show the ignored files:
[cc_shell]
git ls-files -v | grep ‘^[[:lower:]]’
[/cc]

Tags: