git - 使用 github API,创建 git pull 请求而不检查代码

标签 git github github-api

如何使用 github api 为我尚未 checkout 的项目创建 github pull 请求。我想自动对存储库进行简单的更改,我不需要先 checkout 。我只是想从 raw.githubusercontent.com pull 一个文件修改它并创建所述 pull 请求。

编辑 github 网络用户界面允许通过在后台克隆和创建 pull 请求来编辑外部文件。

最佳答案

I haven't checked out using the github api.

你至少应该先 fork repo(参见 GitHub API create a fork)

然后“Create a Pull Request”假定您已将提交推送到专用分支(API“Create a commit”首先,它假定首先是create a tree,基于creating a blob)。

对于所有这些操作,我建议使用 GitHub API 的包装器,例如 go-github ,这可能会使所有系列操作更容易链接。

关于git - 使用 github API,创建 git pull 请求而不检查代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28391901/

相关文章:

git - 启用双因素身份验证后远程 : Invalid username or password. 致命 : Authentication failed,

git push -u origin master,用户名和密码

github - 从 GitHub Actions 中删除工作流程

git - 相当于 Git 中的 Clearcase 流和 View ?

git - GitLab HTTP URL 上的 504 网关超时

git - Openshift 上的 Jenkins 无法克隆 repo

graphql - 通过 GraphQL API 显示 100 多个条目

oauth - GitHub API3 删除访问 token

git - git rebase --onto仅在长分支上崩溃

Git 克隆错误 : RPC failed; result=56, HTTP 代码 = 200