简体   繁体   English

Git:如何打开我本地分支的拉取请求 URL?

[英]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.

相关问题 如何在我的Git分支的本地副本中使用拉取请求? - How to use a pull request in my local copy of a Git branch? 如何使用 git 将 URL 获取到我当前分支的合并请求或拉取请求? - How can I get the URL to a merge request or a pull request of my current branch using git? 如何“不合并”在我的主分支上打开问题的拉取请求 - How to open a pull request for an issue on my main branch "without merging" Git-拉取请求后,我的本地master分支会怎样? 如何管理多个进行中的分支? - Git - What happens to my local master branch after a pull request? How do I manage multiple in progress branches? git - 如何在我的本地计算机上获取在github上启动了拉取请求的分支名称? - git - How can I obtain the branch name from which a pull request was initiated on github, while on my local machine? Git-将另一个远程分支拉到我的本地分支 - Git - pull another remote branch into my local branch 如何使用Git切换到拉取请求的分支 - How to switch to the branch of a pull request with Git Git Pull请求后保持本地分支机构的工作 - Keeping local branch work after Git Pull Request git request-pull从本地分支到远程主服务器 - git request-pull from local branch to remote master 在本地git服务器上创建拉取请求并合并分支 - Creating pull request and merging branch on local git server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM