I\'m using this API to update a file on my repo, it requires me to have a valid SHA blob for a file that I want to update:
http://developer.github.com/v3/repos/contents/
If you don't want to hit the api, you could generate the SHA yourself. Git generates the SHA by concatenating a header in the form of blob {content.length} {null byte}
and the contents of your file. For example:
content = "what is up, doc?"
header = "blob #{content.bytesize}\0"
combined = header + content # will be "blob 16\u0000what is up, doc?"
sha1 = Digest::SHA1.hexdigest(combined)
Source: https://git-scm.com/book/en/v2/Git-Internals-Git-Objects