when i add file to gitignore that is already tracked code example
Example: gitignore already tracked files
# to ignore all files with changes detected
git rm -r --cached .
git add .
git commit -am "Remove ignored files"
# to ignore all files with changes detected
git rm -r --cached .
git add .
git commit -am "Remove ignored files"