To untrack every file that is now in your .gitignore:
Open your working folder in terminal.
First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
This removes any changed files from the index(staging area), then just run:
Commit it: