How to remove node_modules in git

You may accidentally add the node_modules or you forgot to add the node_modules directory to .gitignore list, no worry, you may remove it after you pushed to the git.

First, add the node_modules in to the .gitignore

vim .gitignore

After added the /node_modules and save it.

git rm -r --cached .
git add .
git commit -m "remove gitignore files"
git push origin master

Tags:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.