Skip to content

Instantly share code, notes, and snippets.

@ciamac-da
Created June 22, 2021 12:50
Show Gist options
  • Save ciamac-da/15cd5d554e196a4aa657628d2595e392 to your computer and use it in GitHub Desktop.
Save ciamac-da/15cd5d554e196a4aa657628d2595e392 to your computer and use it in GitHub Desktop.
How to get rid of node_modules folder from Github
# This is how to get rid of node_modules folder from Github!
1- Add .gitignore file(must be located in the root directory of your repo).
2- Write node_modules/ in .gitignore file.
It means ignore all directories called node_modules in current folder and any subfolders.
As alternative you can also use /node_modules or **/node_modules.
** is used for a recursive call in the whole project.
3- Open Terminal
4- git rm -r --cached node_modules
5- git add -A
6- git commit -m "node_modules removed"
7- git push
@Milad-mosadegh
Copy link

Very Nice Bro 👍

@Byjupaul
Copy link

Thanks Cia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment