您的位置:首页 > Web前端 > Node.js

git push之后删除node_modules

2017-05-11 16:43 375 查看
博主最近看了下自己的github,天哪,React目录简直不忍直视。。。

由于node_modules目录之前没有忽略,导致了这种情况,连索引都没法了。。

下面介绍下博主是怎么解决的吧,希望对小伙伴们有帮助。

首先在.gitignore中写入下面代码

node_modules/

jspm_packages/

在命令行进入仓库目录

删除github上.gitignore中新加的选项

git rm -r –cached .

将删除后的add

git add .

再commit

git commit -m”.gitignore is now working”

最后push一下

git push

好了,大功告成,再去看我的github,太干净了。。

顺便附上我的github地址点击进入我的github,志同道合的伙伴可以follow一下哦~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git 删除 node-modules