While working on am Ionic project I noticed that the entire /platforms folder was being committed and pushed to origin even though it was listed in .gitignore as a folder that I didn’t want committed. If you run across this issue here are the 2 simple steps to get those files removed from your commits:
git rm --cached -r .
git add .
Now you can commit and push and your .gitignore files will correctly affect the commited files.