Github API创建提交
我需要有关Github API的帮助,
I need help with Github API,
我需要通过api提交新版本的文件,我正在尝试通过向
I need commit new version of file through api, I'm trying to achieve this by sending post request to
https://api.github.com/repos/:username/:repo:/git/commits/
有数据
{
"login": "username",
"token": "auth_token",
"parent_commit": "sha",
"message": "commit message.",
"content": {
"path": "full/path",
"mode": "edit",
"data": "new content"
}
}
但是它失败并显示结果-找不到.
But it fails with result - not found.
有没有人知道将请求发送到哪里以及这种格式是否正确?
Have anyone idea where to send this request and if this format is right?
(格式由- http://swanson.github.com/blog/2011/07/23/digging-around-the-github-api-take-2.html )
谢谢!
我也对此感到困惑!
提交新内容实际上是使用其低级功能强大的API的多步骤过程.
Committing new content is actually a multi-step process, using their low level and powerful API.
这里是我分享一个解决方案的要点.注意,有些东西是硬编码的,例如分支名称"master".
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.