I don’t think this is really possible, because Syncthing doesn’t distinguish between files and directories when it comes to ignore patterns. The only imperfect solution that I can think about is something like
!*.*
*
yet this will only work if all your files have extensions (which is quite likely, as we’re talking about Windows here, but still).
…sounds logical, but my Syncthing installation seems to be no friend of logics.
If I set up that ignore pattern, files and folders are synced, like there is no ignore pattern at all.
I’ve tested those patterns locally, and they should sync only folders that contain files (with extensions). Have you check what happens in a new pair of folders? Please keep in mind that the patterns will only apply to newly created content, i.e. they won’t delete already existing empty folders.
Thank you for the advice. For every test, I create a new folder and a new txt-file, both with the same timestamp (YYYYMMDDHHMMSS) as name in root. Then I copy an other test file in that folder.
By doing so, I assume I only have “new” folders and files, that are unknown to SyncThing.
Actually folders should not synced - no matter what´s inside.
PS. But you are right - empty folders are not synced…
If I understand correctly, what you actually want may be
// Ignore everything in subfolders.
/*/
// Don't ignore files with extensions in root folder.
!/*.*
// Ignore everything in root folder.
/
however, as already mentioned, this is quite flaky, as files with no extensions will also be ignored, while folders with a . in them won’t be (e.g. Paint.NET).