[英]determine containing pull request from (feature) branch
Is it possible to determine the pull request containing a given branch from command line?是否可以从命令行确定包含给定分支的拉取请求?
I have checked out feature-whatever
branch.我已经检查了
feature-whatever
分支。 It is part of PR #83 (which I can verify via github webbrowser), but I would like to determine this它是 PR #83 的一部分(我可以通过 github 网络浏览器进行验证),但我想确定这一点
$ git status
On branch feature-whatever
Your branch is up to date with 'origin/feature-whatever'.
...
$ git branch -r
origin/HEAD -> origin/develop
origin/PR-82
origin/PR-83
origin/develop
origin/feature/feature-whatever
origin/feature/feature-something-else
origin/main
There may be more than one GitHub pull request that contains any given commit.可能有多个包含任何给定提交的 GitHub 拉取请求。
Given your own git branch -r
output, you want a simple --contains
:给定您自己的
git branch -r
output,您需要一个简单的--contains
:
git branch -r --contains feature-whatever
This should list origin/PR-83
in your case.在您的情况下,这应该列出
origin/PR-83
。 Note that I assume you created origin/PR-83
from GitHub's refs/pull/83/head
name, perhaps with git fetch origin +refs/pull/83/head:refs/heads/PR-83
.请注意,我假设您从 GitHub 的
refs/pull/83/head
名称创建了origin/PR-83
,可能使用git fetch origin +refs/pull/83/head:refs/heads/PR-83
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.