There are times when you want to ignore files that are already managed with Git locally.
This can be achieved using git update-index
command.
For ignoring entire paths recursively, one can use the following commands: $ git ls-files -z | xargs -0 git update-index --skip-worktree $ git ls-files -z | xargs -0 git update-index --assume-unchanged
Aliases can be created to ease usage:
check="git ls-files -v|grep '^S'"
skip() { git ls-files -z "$@" | xargs -0 git update-index --skip-worktree; git status; }
unskip() { git ls-files -z "$@" | xargs -0 git update-index --no-skip-worktree; git status; }