I searched through other questions but can’t find a working solution for my project.
Having a Magento project, I want to exclude everything except this:
/app/design/frontend/default/theme_name # and obviously all subfolders
/skin/frontend/default/theme_name # and all subfolders
I’ve tried a lot of combinations but without luck. Currently I’m stuck with this .gitignore file:
*
!/app/
!/app/*
app/*
!/app/design/
!/app/design/*
But it doesn’t work recursively below the design folder. It only added a test file inside the design folder that I created.
Look at my answer here: Can't understand how gitignore ignores the folders
Quoting from that:
Also, you should look at having
.gitignoreat subdirectory rather than at root level only as it becomes pretty complex if you have to go to the subdirectory level from the root.gitignorebecause of the explanation above, whereby for each level, you have to unignore the folder and then ignore the contents and so on.