skip to Main Content
Remove Node Modules From Git Repository

Remove Node Modules from Git Repository

If you forget to exclude node_modules directory add a .gitignore with the following or add this line to an existing one:


Then run the following command to remove the complete directory from git’s cache:

git rm -r --cached node_modules/

And then add all changes (removals) to the git repository and do a commit :

git add -A && git commit -a -m "excluded node modules"

And then do a:

git push

to update the entire (remote) repository


Been working with WordPress, SEO, content marketing and the web for 12+ years. When I am not coding, reading about the web or dreaming the web of things I travel or run a few blocks

Leave a Reply

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

Back To Top