Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 git 开发网站,但有一件事一直困扰着我。对于共享主机(cpanel)上的站点,我必须在主目录中创建 .gitignore,然后在该文件中放置除“public_html”之外的每个文件夹。有没有其他方法可以排除主目录中的每个文件夹,除了public_html,动态方式?
用于!排除 .gitignore 文件中的模式
!
例如:
*/ !public_html
这不包括除 public_html 之外的所有目录(即使是您将在之后创建的目录)。