您似乎必须与github.com进行交互才能发起拉取请求.是这样吗?
更新:hub命令现在是一个官方的github项目,并且还支持创建pull请求
原文:
似乎是一个特别有用的东西添加到hub命令:http://github.com/defunkt/hub或github gem:http://github.com/defunkt/github-gem
我建议向那些要求它的项目提出问题.github的人非常敏感.
Git现在附带一个子命令 'git request-pull' [-p]
你可以在这里看到文档
您可能会觉得这很有用,但它与GitHub的功能并不完全相同.
使用Hub命令行包装器,您可以将它链接到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.
一个男人搜索像......
man git | grep pull | grep request
给
git request-pull[ ]
但是,尽管这个名字,它并不是你想要的.根据文件:
生成请求,要求您的上游项目将更改提取到其树中.打印到标准输出的请求从分支描述开始,总结了更改并指示它们可以从哪里拉出.
@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] [-h ]
我最终制作了自己的,我发现它可以更好地解决周围的其他解决方案.
https://npmjs.org/package/pullr
我最近创建了一个可以完全满足您需求的工具:
https://github.com/jd/git-pull-request
它可以在一个命令中自动执行所有操作,分叉存储库,推送PR等。如果您需要编辑/修复PR,它还支持更新PR!