I need help with Github API,
I need commit new version of file through api, I\'m trying to achieve this by sending post request to
https://api.gith
I puzzled over this one too!
Committing new content is actually a multi-step process, using their low level and powerful API.
Here is a gist I made to share one solution. Note that a few things are hard coded, like the branch name "master".
Please feel free to fork and improve the gist, or let me know if you're having trouble getting this to run.
Note that since May 2013, you have a CRUD API available:
That includes a file update API
{
"message": "my commit message",
"committer": {
"name": "Scott Chacon",
"email": "schacon@gmail.com"
},
"content": "bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz",
"sha": "329688480d39049927147c162b9d2deaf885005f"
}
(with content being the updated file content, Base64 encoded.)