代码之家  ›  专栏  ›  技术社区  ›  Andrew Johnson

你能从GitHub上的命令行发出拉请求吗?

  •  262
  • Andrew Johnson  · 技术社区  · 15 年前

    似乎您必须与github.com交互才能启动拉请求。是这样吗?

    7 回复  |  直到 7 年前
        2
  •  44
  •   floer32 llogan    8 年前

    'git request-pull' [-p] <start> <url> [<end>]

    here

    it is not exactly the same as GitHub's feature .

        3
  •  26
  •   deargle Flov    10 年前

    Hub command-line wrapper 你可以链接到Git,然后你可以 git pull-request

    从Hub的手册页:

       git pull-request [-f] [TITLE|-i ISSUE|ISSUE-URL] [-b BASE] [-h HEAD]
              Opens a pull request on GitHub for the project that the "origin" remote points to. The default head of the pull request is the current branch. Both base and head of the pull request can be explicitly given in one  of  the  following  formats:  "branch",  "owner:branch",
              "owner/repo:branch". This command will abort operation if it detects that the current topic branch has local commits that are not yet pushed to its upstream branch on the remote. To skip this check, use -f.
    
              If TITLE is omitted, a text editor will open in which title and body of the pull request can be entered in the same manner as git commit message.
    
              If instead of normal TITLE an issue number is given with -i, the pull request will be attached to an existing GitHub issue. Alternatively, instead of title you can paste a full URL to an issue on GitHub.
    
        4
  •  16
  •   hobs axoplasm    7 年前

    一个像…

    man git | grep pull | grep request
    

    给予

    git request-pull <start> <url> [<end>]
    

    但是,不管名字是什么,这不是你想要的。根据文件:

    生成一个请求,请求上游项目将更改拉入 他们的树。打印到标准输出的请求以 分支描述,汇总更改并指出更改的来源 可以拉动。

    @HolgerJust 提到了Github Gem,它可以满足您的需求:

    sudo gem install gh 
    gh pull-request [user] [branch]
    

    其他人提到过这位官员 hub Github包装:

    sudo apt-get install hub
    

    brew install hub 
    

    然后

    hub pull-request [-focp] [-b <BASE>] [-h <HEAD>]
    
        5
  •  5
  •   samccone    13 年前

    最后我自己做了 我发现它比其他解决方案更有效。

    https://npmjs.org/package/pullr

        6
  •  3
  •   jd_    8 年前

    我最近创建了一个工具,可以完全满足您的需求:

    https://github.com/jd/git-pull-request

    它在一个命令中自动执行所有操作,分叉repo,推送pr等。如果需要编辑/修复pr,它还支持更新pr!

        7
  •  0
  •   Andruf    14 年前

    我以前使用过这个工具-虽然看起来需要先打开一个问题,但如果您使用Github问题跟踪,它非常有用,而且确实简化了工作流。git open pull,然后从您所在或选择的任何分支提交一个pull请求。 https://github.com/jehiah/git-open-pull

    编辑:看起来您可以即时创建问题,所以这个工具是一个很好的解决方案。