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



NNAAMMEE
       syncthing-stignore  -  Prevent  files  from being synchronized to other
       nodes

SSYYNNOOPPSSIISS
          .stignore

DDEESSCCRRIIPPTTIIOONN
       If some files should not be synchronized to (or from) other devices,  a
       file  called  ..ssttiiggnnoorree  can  be  created  containing  file patterns to
       ignore. The ..ssttiiggnnoorree file must be placed in the root  of  the  folder.
       The  ..ssttiiggnnoorree  file  itself  will  never  be  synced to other devices,
       although it can ##iinncclluuddee files that _a_r_e synchronized  between  devices.
       All  patterns  are  relative  to  the folder root.  The contents of the
       ..ssttiiggnnoorree file must be UTF-8 encoded.

       NNOOTTEE::
          Note that ignored files can block  removal  of  an  otherwise  empty
          directory.   See  below  for  the  (?d)  prefix to allow deletion of
          ignored files.

PPAATTTTEERRNNSS
       The ..ssttiiggnnoorree 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 ffoooo matches the
         files ffoooo, ssuubbddiirr//ffoooo as well as any directory named ffoooo. Spaces  are
         treated  as  regular characters, except for leading and trailing spa‐
         ces, which are automatically trimmed.

       · AAsstteerriisskk (**) matches zero or more characters in a filename, but  does
         not  match  the  directory  separator.  ttee**nnee matches tteelleepphhoonnee, ssuubb‐‐
         ddiirr//tteelleepphhoonnee but not tteellee//pphhoonnee.

       · DDoouubbllee aasstteerriisskk (****) matches as above, but also directory separators.
         ttee****nnee matches tteelleepphhoonnee, ssuubbddiirr//tteelleepphhoonnee and tteellee//ssuubb//ddiirr//pphhoonnee.

       · QQuueessttiioonn  mmaarrkk  (??) matches a single character that is not the direc‐
         tory separator. ttee????sstt matches tteebbeesstt but not tteebb//sstt or tteesstt.

       · SSqquuaarree bbrraacckkeettss ([[]]) denote a  character  range:  [[aa--zz]]  matches  any
         lower case character.

       · CCuurrllyy  bbrraacckkeettss  ({{}})  denote  a set of comma separated alternatives:
         {{bbaannaannaa,,ppiinneeaappppllee}} matches either bbaannaannaa or ppiinneeaappppllee.

       · BBaacckkssllaasshh (\\) âescapesâ a special character so that it loses its spe‐
         cial  meaning.  For  example, \\{{bbaannaannaa\\}} matches {{bbaannaannaa}} exactly and
         does not denote a set of alternatives as above.

       NNOOTTEE::
          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 ??bbaannaannaa?? to match both [[bbaannaannaa]] and {{bbaannaannaa}}, and so on.

       · A pattern beginning with // matches in the root of  the  folder  only.
         //ffoooo matches ffoooo but not ssuubbddiirr//ffoooo.

       · A  pattern  beginning  with ##iinncclluuddee 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: ##iinncclluuddee mmoorree--ppaatttteerrnnss..ttxxtt.

       · 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 ((??ii)) prefix enables case-insensitive pat‐
         tern matching. ((??ii))tteesstt matches tteesstt, TTEESSTT and ttEEssTT. The ((??ii))  prefix
         can  be  combined  with  other  patterns,  for  example  the  pattern
         ((??ii))!!ppiiccttuurree**..ppnngg indicates that PPiiccttuurree11..PPNNGG should be synchronized.
         On Mac OS and Windows, patterns are always case-insensitive.

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

       NNOOTTEE::
          Prefixes can be specified in any order (e.g. â(?d)(?i)â), but cannot
          be in a single pair of parentheses (not â(?di)â).

       NNOOTTEE::
          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:  !!//ffoooo  is  a top-level include pattern, while !!//ffoooo//bbaarr is
          not.

EEXXAAMMPPLLEE
       Given a directory layout:

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

       and an ..ssttiiggnnoorree 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

       NNOOTTEE::
          Please  note that directory patterns ending with a slash ssoommee//ddiirreecc‐‐
          ttoorryy// 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.

AAUUTTHHOORR
       The Syncthing Authors

CCOOPPYYRRIIGGHHTT
       2014-2019, The Syncthing Authors



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