首页 > 解决方案 > gitignore a given folder in multiple subfolders

问题描述

In my web project, there are two node applications, each having a separate node_modules folder.

main_folder has a client folder and server folder, which are two separate node apps.

I have created a .gitignore file inside main folder and I wish to ignore node_modules folders in both node apps. How do I do that?

Thanks in advance.

标签: git

解决方案


Add node_modules/ to .gitignore in main directory.

Each line in .gitignore represents a pattern that will make git ignore specific files and directories. It should cover all subdirectories as well.


推荐阅读