How to store new iWork (2013) documents in a flat file (for version control)

iworkkeynotenumberspages

With the October 2013 iWork update, the new UI is great but it seems one cannot store documents as 'flat file' any more. This really limits my ability to store the files, essentially ruling self-hosted version control (git, hg etc.) out of the picture.

The problem is:

  • adding a new picture to a document creates a new file within the bundle, which should be explicitly added to the version control

  • removing pictures removes them from the bundle but – again – version control should be notified.

I tried the trick of zipping the bundle and renaming it back to '.pages' (the way iWork'09 handled flat files) but it does not work.

Has anyone else been bit by this – do you have work-arounds (other than using iCloud, Dropbox – I'm fine with some of the documents living there but for some others I'd like to keep closer to my chest)?

Workarounds can be either on the iWork side, or ways that I get i.e. 'hg' (Mercurial) to version the bundle directories nicely.

Addendum

As the SO item says, I solved this by hg addremove. Other suggestions and discussion are still welcome. 🙂

Best Answer

The tool keynote-to-text gives a textual representation of a .key file. You can register it as the text converter for a Keynote file by adding to .gitconfig:

[diff "keynote"]
  binary = true
  textconv = /PATH/TO/KEYNOTE/keynote-to-text 

And .gitattributes:

*.key diff=keynote

Then git diff provides useful output: