how to delete all the files form git which are still managed but gitignore code example
Example: git remove all files in gitignore
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached