[英]Git: How to open my local branch's pull request URL?
I was watching this video: https://youtu.be/9qsX_UsyG-g?t=30我在看这个视频: https : //youtu.be/9qsX_UsyG-g?t=30
And I noticed that he/she had a custom command to open his branch's pull request using propen
我注意到他/她有一个自定义命令来使用propen
打开他的分支的拉取请求
I want to implement this myself.我想自己实现这个。 How would I get my branch's URL so I can open it using open "www.github.com/..."
我如何获得我的分支的 URL,以便我可以使用open "www.github.com/..."
打开它
This is computed by GitHub and similar automatically only when pushing a new branch to your remote:这仅在将新分支推送到远程时由 GitHub和类似自动计算:
$ git checkout -b test/new origin/master
Branch 'test/new' set up to track remote branch 'master' from 'origin'.
Switched to a new branch 'test/new'
✘-128 ~/source/packer [test/new|✔]
$ git push -u origin test/new
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'test/new' on GitHub by visiting:
remote: https://github.com/zaventh/packer/pull/new/test/new
remote:
To https://github.com/zaventh/packer.git
* [new branch] test/new -> test/new
Branch 'test/new' set up to track remote branch 'test/new' from 'origin'.
You'll notice the remote:
prefix to those messages.您会注意到这些消息的remote:
前缀。 The text is actually coming from GitHub in this case and not the client.在这种情况下,文本实际上来自 GitHub 而不是客户端。 Presumably they are using a post-receive
server side Git hook to accomplish this.据推测,他们正在使用post-receive
服务器端 Git hook来完成此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.