Problem: tracked files not being ignored by an updated .gitignore
Solution: untrack the files first then .gitignore will ignore them after
git rm -r --cached . # untrack files, replace "." for any other directory
git add . # re-adding the files
git commit -m "issue fixed" # commiting changes
git push # pushing changes