Run this code in terminal to remove file that's already tracked by git. (allows .gitignore to do it's job).
git rm --cached [file name goes here]
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Workspace Files #
############
*.idea
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db