Offloaded files: Git thinks I've deleted files and added new .icloud files in their place

71 Views Asked by At

My old dusty MacBook that doesn't have much storage space left keeps offloading my Git projects to iCloud Drive, and when I'm about to commit changes, it thinks most of my project is deleted in favour of newly added, unstaged .icloud files.

Running:

git status

… yields a long list of deleted as well as new, unstaged .icloud files.

If I add **/*.icloud to my .gitignore, half the problem is solved.

Is there instead a 'holistic' solution where I can tell git, whenever it encounters **/*.icloud, to read myfile.icloud as just myfile?

1

There are 1 best solutions below

0
someone On

Git does not like living on a network or cloud offloaded drive. It has to control all the files in your sandbox, and needs them to stay locally in your sandbox.

My advice would be to disable cloud offloading for your sandboxes.

Your suggestion to look treat myfile.icloud as if it was myfile sounds reasonable, but the .git folder itself is effectively a database, and if parts of that database change in the background, what you'll get a simply a corrupted and unusable sandbox.