Problem
You have a repository with a .gitignore file. However, the files are still showing tracked changes.
Solution
- Using GIT Bash, navigate to the repository folder (e.g. “cd C:\Projects\Web”)
- Make sure you commit any changes before proceeding to the next step.
- Run this command to empty the repository’s index:
git rm -r --cached .
- Once that has finished, run this command to reindex:
git add .
- Make a new commit, e.g.
git commit -m "Reindexed to fix .gitignore"