I’m currently syncing between windows and macOS. As an example, I want to ignore my .dmg files that are on my Mac to not sync to my windows computer and and my .exe files on windows from going to mac.
I hadn’t been doing this for a while so I currently have a mix of files that are incompatible across devices.
I went and added an extensive ignore list to my .stignore file. Does this only need to go on my Mac? If I do this on my Mac what would the result be when deleting a file on my windows computer?
# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### macOS Patch ###
# iCloud generated files
*.icloud
# End of https://www.toptal.com/developers/gitignore/api/macos
.DS_Store # Finder metadata file
._* # AppleDouble metadata files (created when copying to non-Mac file systems)
.AppleDouble # Apple resource fork storage
.fseventsd # File system events log directory
.Spotlight-V100 # Spotlight search index files
.Trashes # Trash folder files
.VolumeIcon.icns # Custom volume icons
# Ignore macOS-specific application formats
*.app/ # macOS applications (bundles)
*.dmg # macOS disk image files
*.pkg # macOS installer packages
*.sparsebundle # Mac encrypted disk image format
*.sparseimage # Mac disk image format
*.mobileconfig # Mac configuration profiles
In this case, with just two devices, I’d suggest to use the same ignore patterns on both sides. Otherwise, you will end up with different global and local states, and it may be difficult to manage them in the long term.
However, I also need to point out that the ignore patterns listed above are not going work. This is because you seem to have used a gitignore generator to create them, and there are syntax differences between that and Syncthing’s ignore patterns.
For one, you cannot use the # character to comment, you need to use // instead. You must move the comments to separate lines and not put them after the file names as well. The two \r after Icon are also not going to do anything.
Make sure to move those inline comments to separate lines as well. Otherwise, Syncthing will literally look for files matching *.kext/ // Kernel extensions (if applicable).
It seems that Syncthing hasn’t got permissions to delete those files. The error message mentions ignore patterns, however this is unrelated to them, and the folders cannot be deleted, because the files inside them need to be removed first.