After every update to gitignore, follow below steps (this is useless; if you want just to ignore from git; but still keep in git)
===================================================================================================
First, commit all your changes (required)
# remove first everything
git rm -rf --cached .
# add everything again respecting gitignore file
git add .
git ignore but keep file (USEFUL)
===========================
— you can update local git repository by running following command. In this case a file is being tracked in the origin repo. You can modify it in your local repo and git will never mark it as changed
git update-index --assume-unchanged <file>
* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.