我在使用GitHub的时候,将项目上传之后发现node_modules
这个文件太大于是想把它清空了再重新上传,于是我:
cd node_modules
rm -r *
cd ..
git add .
git commit -m "update proj"
git push origin master
以上操作后,没有提示错误,本地的node_modules也的确清空了...
但是远程的GitHub上还是没有清空啊..晕
想知道这是怎么回事?
另外我有一个想法:
我发现即使我将node_modules删了,由于git还会在隐藏文件夹内保存内容,所以文件大小还是很大(201M),想问问有什么破解之法嚒。。。
Generally, node_modules will not be uploaded when uploading front-end projects. Directly npm install through package.json, and git upload. Add all the files you do not want to upload, such as node_modules, to the .gitignore file, and git will automatically ignore it
Use git rm
You need to delete node_modules in the local git repository
Not
git add
,是git rm
The main thing here is that you use git add. This command can add modified files or new files to the cache area, but for deleted files, you should use git add -A. This is Effective.