1.将node_modules从git 追踪中删除
git rm -r --cached node_modules
2.重新提交,从github中删除所有node_modules
git上传忽略node_modules
创建.gitignore 文件,命令输入如下:
touch .gitignore
创建完成,写入你要忽略的文件夹或文件
.DS_Store
node_modules/
dist/
npm-debug.log
/mtk/ 过滤整个文件夹
*.zip 过滤所有.zip文件
/mtk/do.c 过滤某个具体文件
node_modules/ 表示过滤这个文件夹
*.zip 过滤zip后缀文件
demo.html 过滤该文件
!src/ 不过滤该文件夹
!*.js 不过滤java源文件
!index.html 不过滤该文件
https://blog.youkuaiyun.com/qq_37818095/article/details/82145062