Stop git tracking ALL files:
git rm -r --cached
Stop git tracking files in a folder:
git rm -r --cached IntranetCore.Web/wwwroot/js //path relative to gitignore
Start tracking them again
git add IntranetCore.Web/wwwroot/js
Commit changes
git commit -m "Stop tracking generated JS again , keep site.js and menu.js"