git remove all files in gitignore

Shell
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
Source

Also in Shell: