- Create a .gitignore file in the git repo if it doesn't have one
touch .gitignore
- Open up the .gitignore and add the following line to the file
/node_modules
- Remove the node_modules folder from the git repository
git rm -r --cached node_modules
- Commit the git repository without the node modules folder
git commit -m "Removed node_module folder"
- Push the repository to github
git push origin master
Don't forget to add the gitignore and commit it to the repo
git add .gitignore
git commit -m "Added .gitignore file"
git push origin master