application/cache/*
application/cache/folder/*
application/cache/folder/onemorefolder/*
This doesn\'t seem to be working. When I clone the project,
There is another perhaps cleaner way to do this. Rather than having sub .gitignore files in the folders you want to keep. You can put this in the root .gitignore as follows:
application/cache/*
application/cache/folder/*
application/cache/folder/onemorefolder/*
!*.gitkeep
Now just create and commit empty .gitkeep files into the directories as listed above. The folder will then be tracked with those .gitkeep files but none of the contents will be tracked.