问题
In the same flavor as this question, are there any possible complications that can arise when using the two services together?
回答1:
I'd be concerned about the upcoming macOS Sierra's new Optimised storage feature, where not all files in iCloud Drive are stored locally and may instead be requested on-demand.
From my tests, it appears git doesn't trigger the OS to request the file, and instead picks up the placeholder file, named something like .original_filename.icloud
.
回答2:
No, they shouldn’t be used together.
- Apple says “You shouldn’t store app folders, libraries, or .tmp files in iCloud Drive.”
.git
is an app folder. - There is a list of filenames excluded by iCloud Drive that git doesn’t avoid. So, for example, if you name a tag “tmp”, that tag won’t be synced. There’s also nothing stopping git modifying its internal file structure, or iCloud Drive modifying its exclusion list, such that this sync failure always occurs.
- iCloud Drive ignores symlinks, git doesn’t. So,
git status
may return different results on different computers that iCloud Drive is done syncing.
More broadly speaking, git and iCloud Drive are two different lossy implementations of “what are the contents of this directory”, one shouldn’t expect them to be equivalent.
回答3:
I just added a git repo to my iCloud drive on Windows. It looks fine there, but the iCloud drive is polluted with folders named 00 thru ff both on the website and on my mac, as well as a mysterious assortment of items from the repo flattened into the root of the drive.
So I certainly wouldn't recommend it.
回答4:
You should use a solution similar to git-remote-dropbox that accounts for the characteristics of a synced file system to avoid corruption. It is possible that git-remote-dropbox would work with iCloud Drive out of the box.
回答5:
I have been using git inside the Desktop which is setup to sync to iCloud for many months. I haven't seen any issues so far.
I guess if you don't do git operations on two Macs in sync you should be safe.
回答6:
I tried iCloud sync git repository to three Mac machines, among two machines encounter login black screen and freeze symptom always. And Mac running very slow.
Open activity monitor and discover where one 'bird' process just sits there at almost 100% CPU usage all the time without actually accomplishing anything.
The process is linked with the iCloud sync (refer here). Solved this issue once iCloud logout.
Base on other git repo sync discuss, Google Cloud Build may consider.
来源:https://stackoverflow.com/questions/35853139/can-git-and-icloud-drive-be-effectively-used-together