I keep my git repositories in a directory under Documents directory, which puts it in the path of iCloud's Optimized Storage. Often, I'll open a git repository to find files replaced with .icloud placeholder files. Current workaround is resetting the workspace changes, but I sense this may cause some issues.

Example of replacement

Is there a way to exclude subdirectories or files from Optimized Storage? Or any another means to deal with this situation? I do not wish to disable Optimized Storage altogether.


Currently there is no way to exclude subdirectories/files present in Desktop & Documents Folders, if you choose to store them in iCloud and enable Optimize Mac Storage.

A possible workaround for your situation could be to move the git repositories to any directory which is not a subdirectory of ~/Desktop or ~/Documents directory.

A commonly used subdirectory for storing repositories is ~/Developer.

  • Seems this is the best means unless Apple allows exclusion from Optimize Mac Storage. Thank you!
    – Shazbot
    Apr 4 '18 at 20:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .