This has progressed, though not improved, since 2013.
There is a way, in Linux and MacOS, to mount the Google Drive as a remote partition.
From the answers I saw: a shared partition is not how GIT currently works. I was able to put stuff into a mounted S3 bucket via IDrive E2, they have a 10GB free tier. For micro collaborations like a Freelance.com project this could be fine.
My try, on Crostini or Google Colab shell commands to start a GIT repo:
mkdir /mnt/chromeos/GoogleDrive/MyDrive/git_repo
git clone --bare . /mnt/chromeos/GoogleDrive/MyDrive/git_repo/project_root_dir_name.git
Getting files on another Crostini host or from another Colab notebook. This command brings the files to target from mounted GIT repo.
git clone /mnt/chromeos/GoogleDrive/MyDrive/git_repo/project_root_dir_name.git
The path to Google Drive mount can be different from /mnt/chromeos/GoogleDrive/MyDrive
. git pull
, git push
, git add
, git commit
can also be used, results will vary.
Not sure why using Google API directly need to be involved, there is a solution involving OCAML library to make a remote/shared file system mount point that a git repo can be stored in. Google Drive files have versions and pins and such, this is not a speed improvement for GIT. Deleted files go into trash.
Full GIT functionality:
Really not sure how Git would resolve a push synchronization conflicts if two or more guys pushed simultaneously. From answers I saw while researching, using a shared partition for git is a no-no. Looks like Google Drive would absolutely fail at file system hosting for a Git repo. I point to pins, revision history and trash can.
Main need to know: if more time passes (tick tock goes the clock), does a hosted file system git repo get corrupted if there are no network trouble? Certainly Google Drive consistency is not quick, once repo is modified you might have to give it a minute after the push.
In short, S3FS is a better workhorse than Google Drive for a Git remote. But, client system would need S3FS installed, this install might needs sudo
privileges. Google Drive has a convenience of being available on crostini Linux [Chrome OS] without sudo
installs.
Thanks.