Nichole A. Miler
Nichole A. Miler

Reputation: 1381

Add gitignore for node_module failed

I created a .gitignore file and within it I put "node_modules". But when I run git status it still shows my node_modules folder as untracked file. What's wrong?

Upvotes: 0

Views: 158

Answers (1)

VonC
VonC

Reputation: 1324733

If you want to ignore a folder, make sure to add a trailing slash in your .gitignore line:

node_modules/

(not "node_modules" with quotes)

If you still see untracked files, check also the rules with:

git check-ignore -v -- node_modules

Make sure the .gitignore is placed at the same level or above the folder which container node_modules.
Make sure the .gitignore name is correct (case, and no trailing space like '.gitgignore')

Upvotes: 1

Related Questions