Including folders and their contents in a "reverse-ignore" setup

I’m not entirely sure what to call it, but I’m using the setup where you have a * at the bottom of the .stignore, and explicitly include (literally, don’t exclude) folders/files above that *.

At first, I had

!folder1
!folder2
etc
*

But then I realised that this was matching folder1 and folder2 at any level, whereas I wanted to only match those top-level folders.

Would

!/folder1
!/folder2
etc
*

Work for the intended purpose of including folder1 and folder2, and all of their contents? Or would I have to also add !/folder1/** to include its contents? (If so, is there any way in doing this in a one-liner?)

Finally, if I want all other folders and files (apart from the ones explicitly not excluded) to be excluded, do I need a ** or */** at the end rather than a *?

Is there any way of checking what Syncthing is actually excluding? I went to Actions → Logs → Debugging Facilities, but I can’t see an option for ‘ignores’.

The above looks good :slight_smile:.

* is enough.

There is no easy way to check which files have been ignored. I believe you would need to analyse the database to access that information.

Okay, thank you. I have tried that setup now and it seems to be working.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.