似乎你必须与github.com交互来发起一个拉请求。是这样吗?
当前回答
使用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.
其他回答
是的。可以安装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
注意:有些答案现在已经过时了。(2022-01-27) (例如使用gh Gem) 目前唯一能够做到这一点的工具是hub和gh。
一个男人搜索…
man git | grep pull | grep request
给了
git request-pull <start> <url> [<end>]
但是,尽管它的名字,它不是你想要的。根据文件:
生成一个请求,要求上游项目将更改拉入其中 他们的树。打印到标准输出的请求以 分支描述,总结变更并指出变更的位置 可以拉。
@HolgerJust提到了github宝石,做你想要的:
sudo gem install gh
gh pull-request [user] [branch]
其他人提到了github的官方中心包:
sudo apt-get install hub
or
brew install hub
then
hub pull-request [-focp] [-b <BASE>] [-h <HEAD>]
使用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.
我以前用过这个工具-虽然看起来需要先打开一个问题,但如果你使用github问题跟踪,它非常有用,真的简化了工作流程。Git打开拉取,然后从你所在或选择的分支提交一个拉取请求。 https://github.com/jehiah/git-open-pull
编辑:看起来你可以在飞行中创建问题,所以这个工具是一个很好的解决方案。
你可以安装github官方CLI来创建PR和做其他事情。
设置:
Gh auth登录
创建PR:
Gh pr创造
合并:
GH 公关合并
推荐文章
- Git在不改变提交时间戳的情况下进行改基
- VS 2017 Git本地提交数据库。每次提交时锁定错误
- 如何在过去的一些任意提交之间注入一个提交?
- 从GitHub克隆项目后拉git子模块
- GitHub上的分叉和克隆有什么区别?
- 递归地按模式添加文件
- 我如何使用notepad++(或其他)与msysgit?
- 如何将现有的解决方案从Visual Studio 2013添加到GitHub
- 是否可以在GitHub上搜索特定的文件名?
- Git存储库中的悬垂提交和blob是什么?它们来自哪里?
- 我如何简单地从我最新的git提交创建一个补丁?
- Git显示“警告:永久添加到已知主机列表”
- 我如何检索一个回购的远程git地址?
- 如何列出提交,因为某些提交?
- 如何在不位于存储库的情况下执行Git命令?