.history angular 项目的 gitIgnore

gitIgnore for .history angular project

为什么 gitignore 对我不起作用? 为什么 .history 文件夹中的文件没有被忽略?

我不知道你的文件结构到底是什么样的,但在我看来你的 .history 目录的路径在你的存储库的 .gitignore 文件中是错误的。

通过查看 VCS 窗格,在我看来路径应该是 src/.history/*,而不是 .history/*.gitignore 和 Git 中的路径通常是相对于 Git 存储库的基本目录的。

确保先从索引中删除这些文件:

git rm -r --cached src/.history/

然后检查VSCode报告的状态:那些文件不应该存在。

注意:.gitignore 规则应该是

.history/

(不需要'*':您只忽略文件夹,尾随'/':就足够了)