git add to gitignore after commit code example Example 1: apply gitignore after commit git rm --cached $file Example 2: git ignore after commit git rm --cached /\*.exe