In the same flavor as this question, are there any possible complications that can arise when using the two services together?
In the same flavor as this question, are there any possible complications that can arise when using the two services together?
No, they shouldn’t be used together.
.git is an app folder.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.
TL;DR assuming you're using macOS, you can create a sparse disk image with your repo inside and store this image on iCloud Drive safely
Probably not the answer you're looking for, but I think there is an approach that works quite nice for archive or infrequent access storage of your git repo.
The idea is to create a sparse or sparse bundle disk image using Disk Utility.app. You can put a very large size that will represent the maximum available disk space on the disk image. The actual image file size will only use up as much space as actually used on the inside.
Store this sparse or sparse bundle on iCloud Drive, and all you need to do to access your repo is mount the image whenever needed, then work inside of it. This way, iCloud Drive will only have to sync a single binary file (the image), rather than each separate file of the git repository.
The only drawback is that the sparse or sparse bundle size will not decrease when you delete content inside. You may "reclaim" the free space using hdiutil: hdiutil compact my-special-repo.sparseimage.
I've been doing this for a critical local repository I do not wish to host on a remote server, yet had to make sure I didn't lose it while still being usable and up-to-date in case of hardware loss. Little reminder that important data must always be backed up in multiple places.
Here are the steps for those looking for a synthesised walkthrough:
Bonus step
hdiutil compact my-special-repo.sparseimageI 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.
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.
Yes they can be used "effectively" together, though there are edge cases where you may run into problems. Generally I wouldn't advise doing this if you're unfamiliar with how both iCloud and Git behave, and I'd avoid anything with symlinks or large projects with many contributors.
Be especially careful if you use the "optimise storage" feature - it might force you to fix things manually from time to time - but in my experience this is mostly only an issue if you haven't worked on a project for months, and in that case I appreciate saving disk space by not keeping a local copy of every project I've ever worked on.
I find iCloud Drive is a very nice way to have access to all of my repositories across all of my devices (office desktop, home desktop, laptop, tablet, phone).
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.
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.