We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
您将无法通过挂钩脚本自动执行此操作,因为没有
post-push
挂钩。如果您安装 github cli,您可以创建一个类似于以下内容的别名:现在,如果您运行
git Pushpr
它将把当前分支推送到origin
中同名的分支,然后在浏览器中打开拉取请求页面。正如 Matt 在评论中指出的那样,
gh pr
实际上会自动为您完成这一切。忘记别名并运行:它将把你的分支推送到 github 并打开拉取请求页面。
You won't be able to automate this via a hook script because there is no
post-push
hook. If you install the github cli, you can create an alias that looks something like:Now if you run
git pushpr
it will push your current branch up to a branch of the same name inorigin
and then open the pull request page in your browser.As matt points out in the comment,
gh pr
will actually do this for you all by itself. Forget about the alias and just run:And it will push your branch up to github and open the pull request page.