新 Angular 项目缺少应用程序文件夹

New Angular project missing the app folder

我注意到一个新设置的 Angular 项目没有在其 src/app 文件夹中注册更改,所以我查看了该项目的 .gitignore 文件,但没有任何内容导致整个 app 目录被忽略...

搜索词条'app' returns以下,他们不能负责吧?

AppPackages/
App/[pP]layers/

无论如何,我把它们注释掉了,但没有改变。

当我尝试在 GitBash 中添加 app 文件夹时,我得到以下信息:

$ git add app/
The following paths are ignored by one of your .gitignore files:
myAngularApp/src/app

我很困惑是什么导致这个目录被忽略。有人可以帮助我了解我所缺少的吗?

只需尝试使用 git check-ignore:

来检查哪个 .gitignore 的规则是导致此错误的原因
cd /path/to/repository
git check-ignore -v -- app/aFile_inside_app

这会让您更好地了解正在发生的事情。

OP CatarinaRuna确认:

The command revealed that [Aa]pp/ in my .gitignore was the cause, but it wouldn't show up in my search, because I only looked for app : )