iAWriter and Git

March 2014

I’m pretty obsessed with iAWriter as my favorite way to write in Markdown, but my biggest pain point has been that iCloud documents (while syncing beautifully across iOS devices) didn’t have version control, or the ability to easily allow me to share my work across various mediums like Git does. However, with Yosemite we can now access our Cloud Drive as a folder in Finder, which means that we can definitely find it in the terminal, which in turn means we can turn out iAWriter folders into git repositories. Score!

Because the path into the iCloud folder is so nasty, let’s just immediately symlink it:

ln -s ~/Library/Mobile\ Documents/ iCloud

If you navigate here you’ll notice a bunch of folders for various things. For iAWriter you’re looking for one that has a hash, then jp~informationarchitects~Writer. Inside that it will have another folder named Documents.

Inside Documents I created a folder called so-you-are (a book idea I’ve been working on) which I then aliased in my ~.zshrc file like so:

alias soyouare=“~/Library/Mobile\ Documents/74ZAFF46HB~jp~informationarchitects~Writer/Documents/so-you-are”

Once I navigated into that folder, it was git init and git add remote origin as you’d expect!

Thanks to Daniel Miessler who wrote about this in the first place (although his article wasn’t exactly what people wanted, see comments) and this SuperUser thread.