Prefer Newer
Your understanding is not quite complete. When versions of a file are detected to be different, and one of those files is just an updated version of the other, Unison will copy the newer one over the other one.
Now what if you updated each version of single file on two machines without syncing in between the edits? Neither file is an updated version of the other, so it's ambiguous to Unison which one to keep. These files are said to be in conflict, and Unison will prompt you to choose a file (or if you have auto true
set Unison will just skip that file). The prefer newer
option will tell Unison to not be conflicted in cases like this, and just assume the file with the most recent timestamp is the one you want to have synced. This is important if you want Unison to run in the background, with options like auto true
and repeat watch
. Here's the relevant explanation of prefer
from the manual, and note that it only matters if path or file is in conflict:
prefer xxx
Including the preference -prefer root
causes Unison always to resolve conflicts in favor of root
, rather than asking for guidance from the user. (The syntax of root
is the same as for the root
preference, plus the special values newer and older.)
This preference is overridden by the preferpartial
preference.
This preference should be used only if you are sure you know what you are doing!
Force Newer
For force newer
, it looks like you missed the line in the manual right before line you quoted:
Including the preference force root
causes Unison to resolve all differences (even non-conflicting changes) in favor of root. This effectively changes Unison from a synchronizer into a mirroring utility.
So while the prefer
option just syncs a file if there was a conflict (in particular if the file has changed), force
will sync everything regardless of whether there have been changes.