Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在git push之后是否始终从命令行链接到GitHub pull请求?_Git_Github - Fatal编程技术网

在git push之后是否始终从命令行链接到GitHub pull请求?

在git push之后是否始终从命令行链接到GitHub pull请求?,git,github,Git,Github,当我签出一个新的本地分支并推送它时,或者如果我在一段时间后推送到一个分支,我的输出中会得到如下内容: remote: remote: Create a pull request for 'my-branch' on GitHub by visiting: remote: https://github.com/org/repo/pull/new/my-branch remote: 有没有办法让它始终显示出来?正如行所示,此消息只是来自远程端(GitHub)的消息,GitHub仅在推送新

当我签出一个新的本地分支并推送它时,或者如果我在一段时间后推送到一个分支,我的输出中会得到如下内容:

remote:
remote: Create a pull request for 'my-branch' on GitHub by visiting:
remote:      https://github.com/org/repo/pull/new/my-branch
remote:

有没有办法让它始终显示出来?

正如行所示,此消息只是来自远程端(GitHub)的消息,GitHub仅在推送新分支时发送,而不是在后续更新时发送。一、 有时候,我也希望它能出现在以后的推送中

但是,您可以按照建议使用
hub
,也可以创建一个别名,在系统的默认浏览器中打开URL。在macOS上,该别名如下所示:

[alias]
    pr = "!f() { open "https://github.com/org/$(basename "$(git rev-parse --show-toplevel)")/pull/new/$(git rev-parse --abbrev-ref HEAD)"; };f"

然后可以运行
gitpr
打开该链接。在Linux上,您可以将
open
替换为
xdg open

如果推送到现有的分支,为什么要创建PR?@dan1st链接仍然解析为正确的PR,所以这无关紧要。虽然如果有一种方法可以链接到一个现有的公关,如果存在的话,这将是首选。链接将始终是相同的。为什么要显示它?@dan1st在尽可能轻松地推送后打开正确的PR。使用如何?