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