Git - Ignore node_modules folder everywhere

Mehdiway picture Mehdiway · Apr 23, 2015 · Viewed 416.9k times · Source

I have a project containing multiple other projects :

  • Main project
    • Mini project 1
    • Mini project 2

All containing node_modules folder. I want git to ignore the folder no matter where it is starting from the root folder. Something like this to add in .gitignore :

*node_modules/*

Answer

Alik picture Alik · Apr 23, 2015

Add this

node_modules/

to .gitignore file to ignore all directories called node_modules in current folder and any subfolders