.gitignore 中的嵌套模块

nested modules in .gitignore

我有一个简单的 spring 启动和 angular 应用程序。我想将其全部推送到一个存储库,但我不知道如何忽略 node_modules 或如何一次使用这两个 gitignore 文件?这是我的项目结构:

编辑应用程序根目录(初始化 git 存储库的位置)中的 .gitignore 文件并添加 src/main/frontend/node_modules/ 您可以使用多个 .gitignore 文件,但默认情况下仅使用根文件,如果您只需要排除 node_modules 则上述解决方案将起作用。