SYNCTHING-STIGNORE(5)
π syncthing-stignore β bestie's guide to not syncing your whole entire life
okay so real talk, this is the Syncthing manual page SYNCTHING-STIGNORE(5) and it's literally all about one lil file that controls what does and doesn't get synced. sit down, grab a strawberry, we're doing this πβ¨
β¨ NAME β¨
syncthing-stignore β the icon, the legend, the thing that prevents files from being synchronized to other nodes π
πΈ SYNOPSIS πΈ
.stignore
that's it. that's the whole synopsis. she's a file. she's living in your folder. main character energy fr fr π
π¦ DESCRIPTION π¦
so like. if there are some files that should not be synchronized to (or from) other devices? you make a file called .stignore and put file patterns in it to ignore. simple as that, no cap.
the .stignore file must be placed in the root of the synced folder β like, files in other locations are not applied, sorry bestie, them's the rules π
and get this: the .stignore file itself will never be synced to other devices. not ever. but it can #include files that are synchronized between devices, so there's that.
all patterns are relative to the synced folder root, and the contents of .stignore must be UTF-8 encoded. encoding matters, bestie, don't skip it π
NOTE: ignored files can block removal of an otherwise empty directory π yes this is a real problem. see below for the (?d) prefix β it's the thing that allows deletion of ignored files. lowkey important.
π PATTERNS π
the .stignore file contains a list of file or path patterns. and here's the vibe check that matters most: the first pattern that matches will decide the fate of a given file. first match wins, periodt. the way that ordering is everything here, iykyk β
- Regular file names match themselves, i.e. the pattern
foomatches the filesfoo,subdir/fooas well as any directory namedfoo. Spaces are treated as regular characters, except for leading and trailing spaces, which are automatically trimmed. (so spaces are valid, they just get groomed at the edges πββοΈ) - Asterisk (
*) matches zero or more characters in a filename, but does not match the directory separator.te*nematchestelephone,subdir/telephonebut nottele/phone. she stays in her lane β¨ - Double asterisk (
**) matches as above, but also directory separators.te**nematchestelephone,subdir/telephoneandtele/sub/dir/phone. she goes wherever π₯ - Question mark (
?) matches a single character that is not the directory separator.te??stmatchestebestbut notteb/stortest. - Square brackets (
[]) denote a character range:[a-z]matches any lower case character. classy. specific. π - Curly brackets (
{}) denote a set of comma separated alternatives:{banana,pineapple}matches eitherbananaorpineapple. fruit salad behaviour, obsessed ππ - Backslash (
\) "escapes" a special character so that it loses its special meaning. For example,\{banana\}matches{banana}exactly and does not denote a set of alternatives as above.
NOTE: On Windows,\is the path separator, so use|to escape special characters instead. For example,|{banana|}matches{banana}. To use\to escape special characters (and use/as the path separator), insert a#escape=\at the top of the file. Here's a short example:#escape=\ /foo /path/bar/\{banana\} /path/baz\[2\]/ex\[3\].txt#escape=\must be placed at the top of the file, before any patterns β but leading comments, and blank lines are OK π«Ά Any files included using#include(see below) will each need their own#escape=\. every single one, no exceptions. Using#escape=\allows the same file to be synced and used on any operating system. portability slay π
- A pattern beginning with
/matches in the root of the synced folder only./foomatchesfoobut notsubdir/foo. she is rooted, literally π - A pattern beginning with
#includeresults in loading patterns from the named file. It is an error for a file to not exist or be included more than once β οΈ Note that while this can be used to include patterns from a file in a subdirectory, the patterns themselves are still relative to the synced folder root. Example:#include more-patterns.txt.- Any
#includedirectives inside a file loaded by#includerequire paths specified relative to the directory containing the loaded file, rather than the synchronised root directory. (so like, it changes the base for the next level down, keep up bestie π§)
- Any
- 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.
NOTE: Negated patterns that can match items below the folder root will cause Syncthing to traverse otherwise ignored directories π and if the watcher is enabled, those directories will also be watched. Directories ignored before the first negated pattern can however be safely skipped, since the first matching pattern wins. For example:/foo /bar !baz *The directoriesfooandbarwill be entirely ignored. However any other directories present must be scanned entirely to find any items namedbaz, despite the fact that they will be ignored due to the*. As a special case, top-level rooted patterns (e.g.!/foo) do not cause this behaviour:!/baz *In this case, only the directorybazwill be scanned, since everything else is ignored by the*pattern. efficiency icon β‘
- A pattern beginning with a
(?i)prefix enables case-insensitive pattern matching.(?i)testmatchestest,TESTandtEsT. The(?i)prefix can be combined with other patterns, for example the pattern(?i)!picture*.pngindicates thatPicture1.PNGshould be synchronized. On Mac OS and Windows, patterns are always case-insensitive. no cap, that's just how it is π - A pattern beginning with a
(?d)prefix enables removal of these files if they are preventing directory deletion. This prefix should be used by any OS generated files which you are happy to be removed. like, bye girl, you were cute but you're blocking the door πͺπ¨
NOTE: Prefixes can be specified in any order (e.g.(?d)(?i)), but cannot be combined in a single pair of parentheses like(?di). do not do the fusion dance, it will not work π ββοΈ
- A line beginning with
//is a comment and has no effect. The same double slashes in any other place are interpreted literally, e.g. trying to dofile // commentwill make Syncthing look for a file calledfile // comment. she's not a comment unless she's at the start, bestie π
π EXAMPLE π
Given a directory layout starting at the synced folder's root:
.DS_Store
.stignore
foo
foofoo
bar/
baz
quux
quuz
bar2/
baz
frobble
My Pictures/
Img15.PNG
and an .stignore file with the contents:
(?d).DS_Store
!frobble
!quuz
foo
*2
qu*
(?i)my pictures
all files and directories called "foo", ending in a "2" or starting with "qu" will be ignored. The end result becomes:
.DS_Store # ignored, will be deleted if gets in the way of parent directory removal
foo # ignored, matches "foo"
foofoo # synced, does not match "foo" but would match "foo*" or "*foo"
bar/ # synced
baz # synced
quux # ignored, matches "qu*"
quuz # synced, matches "qu*" but is excluded by the preceding "!quuz"
bar2/ # synced, despite matching "*2" due to child frobble
baz # ignored, due to parent being ignored
frobble # synced, due to "!frobble"
My Pictures/ # ignored, matched case insensitive "(?i)my pictures" pattern
Img15.PNG # ignored, due to parent being ignored
look at that. bar2/ survives because of her child frobble. quuz survives because of !quuz sitting above qu*. this is the whole "first match wins" thing in action and it ate, honestly π₯π
NOTE: Please note that directory patterns ending with a slashsome/directory/matches the content of the directory, but not the directory itself. If you want the pattern to match the directory and its content, make sure it does not have a/at the end of the pattern. one slash = completely different behaviour, so heads up π
Added in version 1.19.0: Default patterns can be configured which will take effect when automatically accepting a folder from a remote device. The GUI suggests the same patterns when adding a folder manually. In either case, the .stignore file is created with these defaults if none is present yet. cute lil autopilot moment β¨
Added in version 2.0.0: Windows users can now use the pipe character (|) to escape metacharacters in the .stignore file. Additionally, adding #escape=X to the top of the file, allows users to define X as the escape character for that particular file. windows girlies we won πͺπ
π AUTHOR π
The Syncthing Authors. legends, honestly.
π COPYRIGHT π
2014-2026, The Syncthing Authors
and that's the whole page bestie π«Ά this was v2.1.0, dated Oct 07, 2026 β go forth and ignore responsibly, and remember: the first pattern that matches decides the fate of the file, so order your patterns like you mean it πβ¨
π¦ where this page comes from
- arch rolling: syncthing 2.1.7-1 Β· MPL-2.0
- nixos 26.05: syncthing 2.1.7
- nixpkgs unstable: syncthing 2.1.7
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms