Git ignore node_modules

I have a file structure like this

master is:
~/Exercism/javascript

exercise files are:

~/Exercism/javascript/hello-world
~/Exercism/javascript/protein-translation
~/Exercism/javascript/resistor-color
...etc

EACH one of these folders has a node_modules folder that I want to ignore

My .gitignore file is located in:

~/Exercism/javascript

content of .gitignore:

**/node_modules/

git still won’t ignore the node_modules folders. Is there something I need to run in git? Is my folder in the right place>

I have not committed anything yet but the repo is initiated

23 thoughts on “Git ignore node_modules”

Leave a Comment