When you add something into a .gitignore file, try this:
git add [uncommitted changes you want to keep] && git commit
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
If you remove something from a .gitignore file, and the above steps don't work, try this: