git 请求拉取:如何在命令行上创建 (github) 拉取请求?

git request-pull: how to create a (github) pull request on the command line?

我克隆了一个项目,并将一个只有重命名的自述文件的分支推送到自述文件。我正在尝试在命令行上创建一个拉取请求,只是为了从这里而不是网站尝试 PR。

$ git request-pull origin/master origin readme:readme
The following changes since commit 51320a3a42f82ba83cd7919d24ac4aa5c4c99ac6:

  first commit message

are available in the git repository at:

  git@github.com:example/com:example.git readme

for you to fetch changes up to 891c05c5236341bcbe33ceddc415ae921ee42e44:

  second commit message

----------------------------------------------------------------
Simone Gentili (1):
      Fix

 readme.md => README.md | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename readme.md => README.md (100%)

github 没有显示拉取请求,我也没有看到错误。

Github已发展hub:

hub is a command-line wrapper for git that makes you better at GitHub.

它允许您使用

来做到这一点
hub pull-request

请注意,与 git request pull 不同,此 与通过 Web 界面完成的拉取请求相同。

hub pull-request 命令的文档:https://hub.github.com/hub-pull-request.1.html

尽管它们被称为完全相同的东西,但 GitHub 拉取请求和 'git request-pull' 是完全不同的。

git 请求拉取用于生成要发送到邮件列表的未决更改的摘要。默认情况下,它没有与 GitHub.

集成

GitHub 拉取请求仅是 GitHub 的一个完整功能。它允许合并和集成来自不同 branch/fork 的代码。您可以解决合并冲突、进行代码审查或向 GitHub 拉取请求添加其他评论。

不幸的是,git 命令的命名与 GitHub 功能相似,这听起来好像它们应该做同样的事情。

用Github的新官方CLI(命令行界面):

gh pr create --base master --title "My first cli PR" --body "What did I do?"

查看更多 details and options and installation instructions