git rm -r --cached .
git add .
git commit -m "Untracked files issue resolved to fix .gitignore"
git rm --cached <file>
When you remove something from .gitignore file and the file does not appear to be tracked, you can add it manually as follows:
git add -f <file>
git commit -m "Re-Adding ignored file by force"