I have the folder application/ which I add to the .gitignore. Inside the application/ folder is the folder application/language
application/
.gitignore
application/language
I wanted to track jquery production js files and this worked:
node_modules/* !node_modules/jquery node_modules/jquery/* !node_modules/jquery/dist/*