SYNCTHING-STIGNORE(5)              Syncthing             SYNCTHING-STIGNORE(5)



NNAAMMEE
       syncthing-stignore  -  Prevent  files  from being synchronized to other
       nodes

SSYYNNOOPPSSIISS
          .stignore

DDEESSCCRRIIPPTTIIOONN
       If some files should not be synchronized to (or from) other devices,  a
       file  called  ..ssttiiggnnoorree  can  be  created  containing  file patterns to
       ignore. The ..ssttiiggnnoorree file must be placed in the root  of  the  folder.
       The  ..ssttiiggnnoorree  file  itself  will  never  be  synced to other devices,
       although it can ##iinncclluuddee files that _a_r_e synchronized  between  devices.
       All  patterns  are  relative  to  the folder root.  The contents of the
       ..ssttiiggnnoorree file must be UTF-8 encoded.

       NNOOTTEE::
          Note that ignored files can block  removal  of  an  otherwise  empty
          directory.   See  below  for  the  (?d)  prefix to allow deletion of
          ignored files.

PPAATTTTEERRNNSS
       The ..ssttiiggnnoorree file contains a list of file or path patterns. The  _f_i_r_s_t
       pattern that matches will decide the fate of a given file.

       · Regular file names match themselves, i.e. the pattern ffoooo matches the
         files ffoooo, ssuubbddiirr//ffoooo as well as any directory named ffoooo. Spaces  are
         treated  as  regular characters, except for leading and trailing spa‐
         ces, which are automatically trimmed.

       · AAsstteerriisskk (**) matches zero or more characters in a filename, but  does
         not  match  the  directory  separator.  ttee**nnee matches tteelleepphhoonnee, ssuubb‐‐
         ddiirr//tteelleepphhoonnee but not tteellee//pphhoonnee.

       · DDoouubbllee aasstteerriisskk (****) matches as above, but also directory separators.
         ttee****nnee matches tteelleepphhoonnee, ssuubbddiirr//tteelleepphhoonnee and tteellee//ssuubb//ddiirr//pphhoonnee.

       · QQuueessttiioonn  mmaarrkk  (??) matches a single character that is not the direc‐
         tory separator. ttee????sstt matches tteebbeesstt but not tteebb//sstt or tteesstt.

       · SSqquuaarree bbrraacckkeettss ([[]]) denote a  character  range:  [[aa--zz]]  matches  any
         lower case character.

       · CCuurrllyy  bbrraacckkeettss  ({{}})  denote  a set of comma separated alternatives:
         {{bbaannaannaa,,ppiinneeaappppllee}} matches either bbaannaannaa or ppiinneeaappppllee.

       · BBaacckkssllaasshh (\\) âescapesâ a special character so that it loses its spe‐
         cial  meaning.  For  example, \\{{bbaannaannaa\\}} matches {{bbaannaannaa}} exactly and
         does not denote a set of alternatives as above.

       NNOOTTEE::
          Escaped characters are not supported on Windows, where \\ is the path
          separator.  If  you  still  need  to match files that have square or
          curly brackets in their names, one possible workaround is to replace
          them  with  ??, which will then match any character. For example, you
          can type ??bbaannaannaa?? to match both [[bbaannaannaa]] and {{bbaannaannaa}}, and so on.

       · A pattern beginning with // matches in the root of  the  folder  only.
         //ffoooo matches ffoooo but not ssuubbddiirr//ffoooo.

       · A  pattern  beginning  with ##iinncclluuddee results 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 rel‐
         ative to the folder _r_o_o_t. Example: ##iinncclluuddee mmoorree--ppaatttteerrnnss..ttxxtt.

       · A  pattern  beginning  with  a !! prefix negates the pattern: matching
         files are _i_n_c_l_u_d_e_d (that is, _n_o_t ignored). This can be used to  over‐
         ride more general patterns that follow.

       · A  pattern beginning with a ((??ii)) prefix enables case-insensitive pat‐
         tern matching. ((??ii))tteesstt matches tteesstt, TTEESSTT and ttEEssTT. The ((??ii))  prefix
         can  be  combined  with  other  patterns,  for  example  the  pattern
         ((??ii))!!ppiiccttuurree**..ppnngg indicates that PPiiccttuurree11..PPNNGG should be synchronized.
         On Mac OS and Windows, patterns are always case-insensitive.

       · A pattern beginning with a ((??d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.

       · A line beginning with //// is a comment and has no effect.

       NNOOTTEE::
          Prefixes can be specified in any order (e.g. â(?d)(?i)â), but cannot
          be in a single pair of parentheses (not â(?di)â).

       NNOOTTEE::
          Include patterns (that begin with !!) cause Syncthing to traverse the
          entire  directory  tree regardless of other ignore patterns.  If the
          watcher is enabled, the entire directory tree  will  be  watched  as
          well.

          Top-level include patterns are treated as special cases and will not
          force Syncthing to scan (or watch) the entire  directory  tree.  For
          example:  !!//ffoooo  is  a top-level include pattern, while !!//ffoooo//bbaarr is
          not.

EEXXAAMMPPLLEE
       Given a directory layout:

          .DS_Store
          foo
          foofoo
          bar/
              baz
              quux
              quuz
          bar2/
              baz
              frobble
          My Pictures/
              Img15.PNG

       and an ..ssttiiggnnoorree 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

       NNOOTTEE::
          Please  note that directory patterns ending with a slash ssoommee//ddiirreecc‐‐
          ttoorryy// matches the content of the directory, but  not  the  directory
          itself.  If you want the pattern to match the directory and its con‐
          tent, make sure it does not have a // at the end of the pattern.

AAUUTTHHOORR
       The Syncthing Authors

CCOOPPYYRRIIGGHHTT
       2014-2019, The Syncthing Authors



v1.19.2                          Apr 05, 2022            SYNCTHING-STIGNORE(5)
