In my project I have a gitignore file, that nicely has statement to ignore node_modules, such as:
########################
# node.js / npm
########################
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
logs
results
node_modules
It works just as expected. Git does not see any change within node_modules.
I have changes in a file within node_modules that I would like to include in further commits, as it will change definitely. But at the same time I want to keep the rest of the node_modules ignored. This is example of what I need to "unignore":
node_module/passport-saml/saml.js
Some time ago, I had the same issue. I have followed some instructions how to do it, but I ended up creating a mess... I remember I used git uncheck / untrack or something similar. It took me more time to fix the thing I broke while trying to "unignore" the file. At the end, I ended up manually changing the line of code on the git.
This time I really would like to do it properly.