似乎你必须与github.com交互来发起一个拉请求。是这样吗?


当前回答

我使用简单的别名来创建拉请求,

alias pr='open -n -a "Google Chrome" --args "https://github.com/user/repo/compare/pre-master...nawarkhede:$(git_current_branch)\?expand\=1"'

其他回答

使用Hub命令行包装器,您可以将其链接到git,然后就可以执行 git pull请求

从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.

最后我自己做了,我发现它比周围的其他解决方案更好。

https://npmjs.org/package/pullr

你可以安装github官方CLI来创建PR和做其他事情。

设置:

Gh auth登录

创建PR:

Gh pr创造

合并:

GH 公关合并

是的。可以安装hub CLI util。 在MACOS上:brew安装中心

你需要有一次GitHub令牌登录。

用户->开发设置->个人令牌->生成 (参见:https://github.com/settings/tokens)

git checkout -b mybranch
hub pull-request -b master -h mybranch

#user:     your_user_name
#password: your_git_token

Git现在附带子命令' Git request-pull' [-p] <start> <url> [<end>]

你可以在这里看到文件

你可能会发现这很有用,但它与GitHub的功能并不完全相同。