我从StackOverflow中读到了很多关于此的帖子,但是我无法在我的案例中使用它.
我想忽略除一个以外的所有目录.我在我的.gitignore中添加了这样的东西:
app/design/frontend/base/default/template/
!app/design/frontend/base/default/template/mymodule/
Run Code Online (Sandbox Code Playgroud)
但看起来这种否定根本不起作用.
路径下有很多子文件夹,如果它有任何不同app/design/frontend/base/default/template/,在app/design/frontend/base/default/template/mymodule文件夹中有一些文件.
谁能告诉我这里我做错了什么?
将白名单项放在忽略项的顶部:
!app/design/frontend/base/default/template/mymodule/
app/design/frontend/base/default/template/
Run Code Online (Sandbox Code Playgroud)
如果仍然无效,您可能必须包含template目录本身,但忽略它下面的所有文件,除了mymodule:
app/design/frontend/base/default/template/*
!app/design/frontend/base/default/template/mymodule/
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅gitignore手册页.