文件模式¶
描述¶
如果某些文件应与其他设备同步或不同步, 配置相应SyncFilePattern/IgnoreFilePattern. 所有模式均相对于文件夹根 (进入DevMode时选择的文件夹).
IgnoreFilePattern的优先级高于SyncFilePattern
因此,如果您的模式都涵盖了同一文件,则该文件将被忽略。
模式语法¶
-  
foo(常规文件名) 与自己匹配, 即模式foo匹配文件foo,subdir/fooas well as any directory namedfoo. Spaces are treated as regular characters, except for leading and trailing spaces, which are automatically trimmed. -  
*(星号) matches zero or more characters in a filename, but does not match the directory separator.te*nematchestelephone,subdir/telephonebut nottele/phone. -  
**(双星号) matches as above, but also directory separators.te\*\*nematchestelephone,subdir/telephoneandtele/sub/dir/phone. -  
?(问号) matches a single character that is not the directory separator.te??stmatchestebestbut notteb/stortest. -  
[](方括号) denote a character range:[a-z]matches any lower case character. -  
{}(大括号) denote a set of comma separated alternatives:{banana,pineapple}matches eitherbananaorpineapple. -  
\(反斜线) “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. Escaped characters are not supported on Windows. -  
/、./(斜杠) 仅在文件夹根部开始的匹配模式。/foo或./foo匹配foo但不匹配subdir/foo. -  
(?i)(不敏感) 前缀开头的模式可以实现对案例不敏感的模式匹配。(?i)test匹配test,TEST和tEsT. 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. 
可以按任何顺序指定前缀 (如 “(?i){foo,bar}/*/bar”), 但不能单一的括号 (不是 “{foo,(?i),bar}/*/bar”).
例子¶
给定目录布局:
以及以下配置:
IgnoreFilePattern的优先级高于SyncFilePattern,最终结果变为: