【问题标题】:How to create a pull-request in github from the command line [duplicate]如何从命令行在 github 中创建拉取请求 [重复]
【发布时间】:2021-05-26 14:42:18
【问题描述】:

假设我对文件进行了一些更改,并将更改提交并推送到我推送到 github 的新分支,即类似这样的内容:

git commit -m "some changes"
git checkout -b testbranch
git push --set-upstream origin testbranch

现在我想从命令行创建一个拉取请求。我试过了

git request-pull testbranch git@github.com:alex4200/hello-world.git

但这是说

warn: No match for commit a7c79dc732b3f00d6cf6ffe98e6c79de87110b7b found at git@github.com:alex4200/hello-world.git
warn: Are you sure you pushed 'HEAD' there?

但我在 github 上看到具有给定提交哈希的给定分支下的提交。

我现在误会了什么?

【问题讨论】:

  • 使用PR API
  • @Liam 如果不可能,我会尝试。但是为什么像request-pull这样的命令首先存在呢?
  • 值得注意的是,PR 不是 GIT 的东西。这是一个工作流程的事情。 GIT 是源代码控制而不是工作流
  • 因为 GIT 没有 PR 的概念。这是 Github 上的东西。就 GIT 而言,Pr 只是一个合并
  • @Liam 感谢您提供的信息,但它不起作用。我得到message:Not found。我想我还没有创建另一个 SO 问题...

标签: git github


【解决方案1】:

我现在误会了什么?

您将 Git 请求拉取与 GitHub 拉取请求混淆了。

Git 请求拉取实际上是给朋友的消息请求他们从你那里拉取。与 GitHub 无关。

您正在寻找hub 工具:

https://hub.github.com/hub-pull-request.1.html

有关安装说明,请参阅

https://github.com/github/hub

【讨论】:

    猜你喜欢
    • 2020-07-22
    • 2014-11-22
    • 1970-01-01
    • 2019-02-04
    • 2015-10-17
    • 1970-01-01
    • 2019-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多