Link: Git

The series of commands below will remove all of the items from the Git index (not from the working directory or local repository), and then will update the Git index, while respecting Git ignores. PS. Index = Cache

git rm -r --cached .
git add .
 
git commit -am "Remove ignored files"