git cache rm code example
Example 1: git clean cache
$ git rm -r --cached .
Example 2: gitigore rm cache
git rm -r --cached .
Example 3: git rm cached
$ git rm --cached filename
Example 4: remove gitignore files
git ls-files --ignored --exclude-standard -z | xargs -0 git rm --cached
git commit -am "Remove ignored files"
// answer from: thSoft