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

Author: Justin Soo

https://plus.google.com/105604283199591348183

Leave a Reply

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