The commits API and pull requests API support diff and patch formats:
application/vnd.github.VERSION.diff
application/vnd.github.VERSION.patch
application/vnd.github.VERSION.sha