add file to gitignore after commit code example
Example 1: apply gitignore after commit
git rm --cached $file
Example 2: apply gitignore to current commit
#First commit all changes
git rm -r --cached .
git add .
git commit -m ".gitignore updated"
Example 3: git ignore after commit
git rm --cached /\*.exe
Example 4: how to add filer to git ignore
go to the gitignore file, add the name of the file to ignore