I am using my .gitignore and various wildcards to only push to a repo (shared with others) particular folders or subfolders. Some of those .gitignore statements involve doing a general ignore and excepting from that ignore certain other folders. For example.
Solved/ #this prevents any folders named Solved from being pushed Activities/ #this prevents any folders named Activities from being pushed !01-Excel/Activities #this allows Activities folders under this directory to be pushed despite the line above. !01-*/**/Activities #this permits any folders which begin with "01-" and have a subfolder that has a folder named Activities to be pushed, despite the line above.
Here is my question.
How to use wildcards in .gitignore to permit any folder which has a particular string somewhere it is name to be pushed.
I have a folder like this:
01-Excel/Activities/01-Ins_codeStart/Solved/
02-Excel/Activities/02-Stu_codeProgress/Solved/
I would like the git ignore to work such that the Solved folders under any directory with the string "Ins" anywhere in it are pushed, while the Solved folders under any other directory are not.
Here is what I have tried:
!01-Excel/Activities/*-Ins*/Solved
!01-Excel/Activities//**-Ins*/Solved
!01-Excel/Activities//??-Ins*/Solved
None of those work to enable pushing of the Solved folder under directories with "Ins" somewhere in their name.
I recognize this is sort of way in the weeds, but the ability to achieve this would be a huge time saver in my circumstance. Thanks.