Help for patern exclude

Hello , I need help, I am exclude all files except .jpg extensions .mp4 . I try :

! .jpg ! .mp4 *

But it does not work

How please ? Thank you.

This should work:

!*.jpg
!*.mp4
*
1 Like

Hello , I try this but the subdirectory does its not taken into account, such as:

tutu.jpg
foo \ tata \ titi.jpg

titi.jpg not syncro .

thank you

Your post is quite unclear in what you mean. I’ve added triple-ticks

```
around your snippet, but you should probably not have spaces around the backslashes, and you may want to exclude something using the ! operator.

I think he means, that the file titi.jpg inside the sub folder foo\tata\ is not synchronized, as it is not handled by the !*.jpg ignore pattern.

@jresine: the lines inside the .stignore file should not have any spaces (like in your first post). Are you sure, your files contains exactly the 3 lines of my previous post?

I use *.jpg in some of my ignore files and it ignores all jpg files, even in sub folders. Could it be, that the ! notation handles this differently?

You probably need to unignore directories preceeding the file too.

So the complete .stignore file should be:

!*.jpg
!**/*.jpg
!*.mp4
!**/*.mp4
*

right?

Hello and thank you for your response . wweich your script does not work either. subdirectory are not ignored :confused:

You probably need

!/tutu.jpg
!/foo/
!/foo/tata/
!/foo/tata/titi.jpg
*

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