How to stop git from tracking a file recent added to gitignore
- Open Terminal and navigate to the local repository
- Ensure you are in the default branch
- Remove the file from the cache
- Commit
- Push the change
cd ...
git checkout master
git rm --cached <filename>
git commit -am 'Removed files from the index (now ignored)'
git push origin master