Exclude folders containing folder name match

Get help for specific problems
Posts: 1
Joined: 13 Jan 2018

smann

I have a bunch of git repositories in the folder structure I'd like to sync and I don't want to have to exclude each manually or forget to exclude when I add a new repository.
Is there a way to exclude a parent folder if it contains a specific directory or file name?
For example
C:\USERS\NAPLA\DESKTOP\TEST_SYNC_FILTER
├───should_not_sync
│   │   should-not-sync-content.txt
│   │
│   └───.git
│           dotgitcontents.txt

└───should_sync
        should-sync-contents.txt
Thanks!