why a file add to git ignore still available code example
Example 1: git ignore file is not working
git rm -rf --cached .
git add .
Example 2: how to git ignore a file
git config --global core.excludesfile ~/.gitignore_global
git rm -rf --cached .
git add .
git config --global core.excludesfile ~/.gitignore_global