I have a project containing multiple other projects :
All containing <
Add below line to your .gitignore
*/node_modules/*
This will ignore all node_modules in your current directory as well as subdirectory.