问题
- 已经把文件加入git仓库
- 又已经加进去但是没有提交的文件想要忽略
- 如何修改gitignore使其生效
操作
- 编辑gitignore文件
- 从缓存中移除要忽略的文件
- 提交gitignore文件
$ git rm -r --cached .
$ git add .
$ git commit -m ".gitignore is now working"
$ git push
$ git rm -r --cached .
$ git add .
$ git commit -m ".gitignore is now working"
$ git push