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:
This works for me in Sourcetree 2.7.6. I put the absolute path of sketchtool in my
~/.gitconfig
and added a single-line.gitattributes
file as per above, directly in the repo. Now in SourceTree, instead of seeing a comparison of the bitmap preview of the doc, I see a text diff of the changes.Thanks