Why am I getting “Error while copying X to Y. File exists”?

Case sensitivity is a property of volumes. On case-sensitive volumes, it is allowed for two filenames to differ only in the case of a letter, whereas on case-insensitive volumes, it is not allowed. For example, on case-sensitive volumes there could be two files named file.txt and File.txt, whereas on case insensitive volumes only one of the two can exist. By default, macOS is installed on a case-insensitive volume.

If you keep the case of filenames consistent between source and destination and don’t use filenames that differ only in the case of some letters, then you won’t even notice if the volumes are case-sensitive or insensitive. Otherwise, when syncing to a destination on a case-insensitive volume, you might get an error “Error while copying X to Y. File exists”, which can be caused by:

  • A source file and a destination file with similar names, differing only in the case of some letters. The best solution is to enable the option “Remove files not on source”, which fill remove destination files that don’t exist on the source with the exact same name, so that the source file with the similar name can then be copied. After the sync, the option “Remove files not on source” can be disabled again.
  • Multiple source files with similar names, differing only in the case of some letters. Since these files cannot coexist on the case-insensitive destination volume, the best solution is to use different names.