how to apply gitignore after commit code example
Example 1: git untrack file
git rm --cached filename
Example 2: apply gitignore after commit
git rm --cached $file
Example 3: apply gitignore to current commit
#First commit all changes
git rm -r --cached .
git add .
git commit -m ".gitignore updated"