为什么 .gitignore 不忽略我的文件? [英] Why is .gitignore not ignoring my files?

查看:16
本文介绍了为什么 .gitignore 不忽略我的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

见下图.我的 .gitignore 文件应该忽略 src/dist 中的所有文件,但不是.

See the image below. My .gitignore file should be ignoring all files in src/dist, but isn't.

推荐答案

.gitignore 仅忽略不属于存储库的文件.如果您已经 git add 编辑了一些文件,它们的更改仍将被跟踪.要从您的存储库(但不是从您的文件系统)中删除这些文件,请对它们使用 git rm --cached.

.gitignore only ignores files that are not part of the repository yet. If you already git added some files, their changes will still be tracked. To remove those files from your repository (but not from your file system) use git rm --cached on them.

这篇关于为什么 .gitignore 不忽略我的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆