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

查看:52
本文介绍了为什么.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 ed一些文件,它们的更改仍将被跟踪. 要从存储库(而不是文件系统)中删除这些文件,请在它们上使用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天全站免登陆