remove gitignore files code example

Example 1: git ignore still tracking

git rm --cached <file>

git rm -r --cached <folder>

Example 2: git remove all files from gitignore

git ls-files -i --exclude-from=.gitignore | %{git rm --cached $_}

// works with windows powershell

Example 3: git ignore remove

git rm -r --cached .
git add .
git commit -m "Removing all files in .gitignore"

Example 4: github untrack files

git rm -r --cached .

Example 5: remove gitignore files

git ls-files --ignored --exclude-standard -z | xargs -0 git rm --cached
git commit -am "Remove ignored files"


// answer from: thSoft

Example 6: git remove file from gitignore

git rm --cached <file>