Question

I read many posts from StackOverflow about this, but I can't get it working in my case.

I would like to ignore all directories except for one. I added something like this to my .gitignore:

app/design/frontend/base/default/template/
!app/design/frontend/base/default/template/mymodule/

but it looks like the negation doesn't work at all.

There are many subfolders under the path app/design/frontend/base/default/template/, and within the app/design/frontend/base/default/template/mymodule folder there are some files if it makes any difference.

Can somebody tell me what I'm doing wrong here?

Was it helpful?

Solution

Put the whitelist item on top of the ignore item:

!app/design/frontend/base/default/template/mymodule/
app/design/frontend/base/default/template/

If that still doesn't work, you may have to include the template directory itself, but ignore all files beneath it except mymodule:

app/design/frontend/base/default/template/*
!app/design/frontend/base/default/template/mymodule/

For more information, see the gitignore man page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top