github clean gitignored files code example
Example 1: git remove untracked files
git clean -f
Example 2: git remove all files in gitignore
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
git clean -f
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached