You need to have SketchTool installed somewhere in your path.
Add this in your ~/.gitconfig
file (for some reason, it won't work in a local .gitconfig file):
[diff "sketchtool"]
textconv = "sketchtool dump"
cachetextconv = true
binary = true
and then add this in your local or global .gitattributes
file:
*.sketch diff=sketchtool
Now, whenever you modify a .sketch file in your repo, running git diff
will produce a nice text diff like this:
Note that as of recently, sketchtool doesn't come with an installer any more. I've worked around this by adding
/Applications/Sketch.app/Contents/Resources/sketchtool/bin/
to my$PATH
. You could probably also use a symlink.