Exclude Subdirectories

I saw the post at how to exclude all subfolders but I’m still confused. Which answer is correct? And as to the answers that say things like

! /*
*

, um, where do I put this?

I would’ve expected a switch in settings somewhere to include or exclude subdirectories, but found nothing.

Very close… the space between ! and /* is part of the pattern, so unless you have a directory name that’s just a single space (not allowed in Windows), the patterns should be:

!/*
*

1st line says “include all files found at the root of the Syncthing folder” while the 2nd line says “exclude everything”.

Because pattern matching stops at the first successful match, files at the root are matched and not excluded by the 2nd pattern, while subdirectories fall thru the 1st pattern and are caught by the 2nd pattern.

If done manually, put it in a .stignore text file at the root of the Syncthing folder – e.g. if you’re using Windows and the folder to sync is C:\Sync, then the ignore patterns are in C:\Sync\.stignore.

In Syncthing’s web UI, expand the folder panel → click [Edit] → click “Ignore Patterns” tab.

1 Like