DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far...

Welcome! This is a Q&A website for computer programmers and users alike, focused on helping fellow programmers and users. Read more

What are you stuck on? Ask a question and hopefully somebody will be able to help you out!
+2 votes

I've tried syncthing the home folders of two linux computers but I've gotten a few sync-conflict files. So now instead I want to ignore all except a few folders. Why am I not getting any matches when adding the following to the .stignore file located in the home folder?

**
!/docs
!/.config

Here I'm trying to ignore everything except for ~/docs and ~/.config.

Edit: I ended up using:

!/code
!/docs
/.config/syncthing
!/.config
!/.mozilla
!/.stignore
*

The documentation for ignoring files.

by
edited by

1 Answer

+1 vote
 
Best answer

The documentation says

The first pattern that matches will decide the fate of a given file

So, they are matched top to bottom. It also says

A pattern beginning with a ! prefix negates the pattern: matching files are included (that is, not ignored). This can be used to override more general patterns that follow.

Given that, did you try this?

!/docs
!/.config
*
by
selected by
Contributions licensed under CC0
...