Mac OSX is your preferred operation system as a developer? Then chances are good that you already use iCloud. Apple introduced iCloud Drive with OSX 10.10 (Yosemite) which grants you direct access to your remote iCloud folder. Finally you can move files directly between your local harddrive and iCloud back and forth.
iCloud Drive can easily be used as remote storage for your private git repositories. You don't have to use third-party services like Dropbox anymore. Read further for a quick and simple 3 min tutorial.
Still there? Great! Open your terminal and proceed to the next 4 steps...
iCloud Drive is hidden in a verbose library folder accessible from the users home directory. We first create a symlink to simplify access to this directory via terminal:
Now we can simply
~/icloud. All changes to this directory will automatically be synchronized with your iCloud account.
Next we create a bare git repository in iCloud Drive which later serves as remote
origin for our project:
We're ready to create the actual git project. I'm using
~/projects as the root directory for all my dev projects. You might change this to fit your needs.
First we create a new project directory and add two files
Next we initialize a git repository for this project and add the bare repository created in step 2:
Finally we verify that the git repository has been successfully uploaded by checking the web ui of iCloud Drive:
That's it. Now we can simply use commands like
git pull and
git push origin :branch to work with the iCloud Drive git repository.