I was comparing folders between two computers and the comparison revealed that I have several folders that contain multiple files that begin with .sync-conflict…
The provided link does really point to a chapter in the manual which describes conflict resolution. However, for obvious reasons, the manual describes the way to deal with conflicts only in principle, because Syncthing does not know how to generally resolve conflicts. Content conflicts need to be solved it a file-type-specific way.
That is why it keeps both files in case of a conflict for you to handle manually.
If you don’t care about data loss, you can change a setting which causes Syncthing to always only keep the newest file in case of conflict. But you must be aware of the real risk of data loss. Consider the following example: You and a friend have a synched docx file. When your devices are not connected you and your friend edit that document on two devices more or less simultaneously. Later, when the devices connect, Syncthing detects the conflict and silently throws away your edits or your friend edits, whoever happened to press “Save” last.
These .DS_Store files are a special case. They are used by MacOS to cache some metadata about files in the folder and are updated in the background by each Apple device. There is not much sense in synchronizing them, so they should rather be ignored by Syncthing on all devices. That will make it stop detecting conflicts about these specific files.
Edit your folder configuration in Syncthing, go to the Ignore Patterns tab and enter (?d).DS_Store on a line of it’s own. Do that on all involved devices. Then delete all the conflict copies for these files. See Ignoring Files — Syncthing documentation, there is even an example with an entry for exactly this type of files.
I’m the only one using SyncThing across my “collection” of Mac computers so it appears that these are “self-inflicted”.
I think my solution will be “don’t open the same file on different machines” and I’ll be good going forward.
Thanks for your reply and explanation, it’s very much appreciated.
Make sure you don’t have a space in that pattern (as typed in your reply). This is what it should look like:
(?d).DS_Store
These files reappearing means that the ignore pattern probably didn’t work because of the extra space. When a MacOS device then looks at the folder, the file is recreated quickly. Then synced to the other devices. You need to get the pattern right, otherwise it sounds all good.
Note that if you want to get rid of these files everywhere, you should first ignore them only on the MacOS devices. Then delete them on any non-MacOS device, which will propagate to all others with non-MacOS. It’s not really necessary to add the same ignore pattern on these other devices afterwards, but recommended to have the same everywhere.