Ignore pattern not working as expected

Hello,

I am trying to sync only a certain file types present in a folder.

My folders contain .jpg and .CR3 files. I would like to sync only .jpg files and ignore the .CR3 files.

I am using the following Ignore Pattern

!.jpg
(?i)!.jpg
*

When I use this pattern, none of them are getting synced. In fact, the ‘Local State’ of the folder shows zero files.

Then, when I remove the ‘*’ at the last line, it syncs both .jpg and .CR3 files. Can someone help me understand what mistake I am making?

I am working on a Windows machine and syncing to a Windows machine.

Thank you!

Please try:

(?i)!*.jpg
*

If it’s only Windows, you also don’t need the (?i).

1 Like

It works! Thank you so much!

I would like to apply this rule to all the subdirectories, how can I do this? Thank you!

What do you mean? (?i)!*.jpg will apply to all files in the folder, regardless of their specific location.

Does this ignore rule apply to the subfolder of the folder in which this rule is present? (in this case, does it include the .jpg files in the subfolders and ignore other file types). Thank you!

Yes, if there is no specific path defined, the rule applies to everything.