remove files from git and ignore code example
Example 1: git ignore still tracking
git rm --cached <file>
git rm -r --cached <folder>
Example 2: git remove all files in gitignore
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached